Archived

This topic is now archived and is closed to further replies.

DDrawClipper in full screen, help?

This topic is 5968 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i tried to link up a clipper for my Proggie. it works on fullscreen and i dont want my characters to pop up, so i used a clipper. whats wrong? doing:
  
if ( FAILED(lpDD->CreateClipper(0,&lpClipper,NULL)) ) {
		MessageBox(hWnd,"Failed to create a Clipper","DDraw",MB_OK);
		return FALSE;
	};
lpClipper->GetHWnd(hWnd)
lpDDSBack->SetClipper(lpClipper);
  
was perfect, but each time i flip()ed, i could see my window from the win32 gui flashing. and not so perfectly, it clipped where my taskbar supposed to b in. desparatbly, i tried to define it myself (unsucessably ofcourse):
  
if ( FAILED(lpDD->CreateClipper(0,&lpClipper,NULL)) ) {
		MessageBox(hWnd,"Failed to create a Clipper","DDraw",MB_OK);
		return FALSE;
	};
_RGNDATA rgn;
_RGNDATAHEADER rdh;

rdh.dwSize=sizeof(rdh);
rdh.iType=RDH_RECTANGLES;
rdh.nCount=1;
rdh.nRgnSize=0;
rdh.rcBound.bottom=Screenh;
rdh.rcBound.right=Screenw;
rdh.rcBound.top=rdh.rcBound.left=0;

rgn.Buffer[1]=sizeof(RECT);
rgn.rdh=rdh;
lpClipper->SetClipList(&rgn,0);
lpDDSBack->SetClipper(lpClipper);
  
anyone can help here? 10x, Gil Micro$oft beta testing: "Does the splash screen works? SHIP IT!!!"

Share this post


Link to post
Share on other sites
I made a function that would clip the sprite RECTs (w/BltFast, source RECTs that is!) in Visual Basic (as I am currently BAD with C++! ) However, I think I may be able to convert it into C++ for you.... Here I go!

Visual Basic Version

Public Function MakeOSRect(eX, eY, exsRct As RECT) As RECT
Dim a As RECT
Dim X As Long
Dim Y As Long

X = Round(eX)
Y = Round(eY)
a = exsRct

If X < 0 Then a.left = a.left - X + 1
If Y < 0 Then a.top = a.top - Y + 1
If X + a.right > dxW Then a.right = a.right - (X + a.right - dxW)
If Y + a.bottom > dxH Then a.bottom = a.bottom - (Y + a.bottom - dxH)

MakeOSRect = a

End Function

DxW and DxH are the Width and Height of the Directdraw application...

C++ (Hopefully!!! Version)

[RECT in VB; is it lpRECT in C++?] MakeOSRect(int eX, int eY, [RECT?] exsRct)
{
long int X;
long int Y;
[RECT?] a;

X = eX;
Y = eY;
a = exsRct;

if( X < 0 )
{
a->left=a->left-X;
a->left++;
}
if( Y < 0 )
{
a->top=a->top-Y;
a->top++;
}
if( X+a->right > DxW )
{
a->right=a->right-(X+a->right-dxW)
}
if( Y+a->bottom > DxH)
{
a->bottom=a->bottom-(Y+a->bottom-dxH)
}

RETURN a;
}

Well some C++ expert may want to kill me, as that is definately an insult to the language :D. Maybe someone with more C++ experience could PROPERLY code it for ya.

Sastraxi

Times of War
http://crystal-rain.cjb.net/

Share this post


Link to post
Share on other sites