Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


DDraw clipper problems.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 voodoo   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 January 2000 - 07:56 PM

When I create a clipper and attach it to my back surface, using the folowing methods. void DDCreateClipper(LPDIRECTDRAWCLIPPER &pClipper) { if(DDraw4->CreateClipper(0,&pClipper,NULL)!=DD_OK) Message("Failed to create clipper."); } void DDAttachClipper(LPDIRECTDRAWCLIPPER pClipper, G16SURFACEPTR pSurf) { if(pSurf->Surface->SetClipper(pClipper) != DD_OK) Message("Failed to attach clipper to surface."); } Somehow, my FIllSurface function does not work. I use FillSurface to clear up any surface to any color I want. This is my FillSurface function: void FC FillSurface(G16SURFACEPTR pSurf, USHORT pColor) { DDBLTFX BLTFX; ZeroMemory(&BLTFX, sizeof(DDBLTFX)); BLTFX.dwSize = sizeof(BLTFX); BLTFX.dwFillColor = pColor; pSurf->Surface->Blt(NULL, NULL, NULL, DDBLT_COLORFILL / DDBLT_WAIT, &BLTFX); } Now, if I dont create the clipper the fillSurafce works fine and clears the screen. I have also noticed that if I create the clipper using the region data method by definning my own clip rectamgles and set it to the screen res FillSUrface works fine! Any ideas?

Sponsor:

#2 voodoo   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 January 2000 - 08:24 PM

Hehe I solved my own problem.

For the clipper to work properly you must specify for it the size of the clipping region, there''s 2 ways either by getting the Window Handle or by manualy creating your own region data.

So I guess if the clipper does not have a size set any blt calls you make will be completley invisible!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS