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!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Clearing a surface in DDraw


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
2 replies to this topic

#1 Omalacon   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 October 1999 - 07:40 AM

I am using double buffering (2 attached surfaces then flipping), but every time I flip I need to mannually clear the last image on the surface mannually (by writing each pixel to black). Is there a way to clear the entire screen easily with one command? (Like in the old Basic days with CLS)

-Omalacon

[This message has been edited by Omalacon (edited October 27, 1999).]


Sponsor:

#2 mhkrause   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 October 1999 - 07:35 AM

If it's a D3D app, you should call clear() using the D3D device. If it's a regular DDraw app, try calling Blt(), specifying color fill and passing in black.



#3 Machaira   Moderators   -  Reputation: 1028

Like
Likes
Like

Posted 27 October 1999 - 07:40 AM

Try this:

code:

DDBLTFX ddbltfx;

ZeroMemory(&ddbltfx, sizeof(ddbltfx));
ddbltfx.dwSize = sizeof(ddbltfx);
ddbltfx.dwFillColor = 0;
pDDS->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);


where pDDS is a DirectDraw surface. Hope this helps.





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