Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


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