Skip to main content
GameDev.net gamedev.net
🔒 Locked

Direct X Surfaces

Started by cxi2 Nov 23, 2000 at 12:28 AM 0 replies 150+ views
Original Post
cxi2
cxi2
How in the world do you clear a back buffer surface? I blit an image to it, then I blit another one, and it locks up my computer. I think its because I am not clearing the surface before I reblit to it. Help is much appreciated to Code, or Not To Code
to Code, or Not To Code
Ironblayde
Ironblayde
You must be doing something else wrong; there''s no need to clear the surface before blitting a second image over the first one. After all, clearing the surface itself amounts to blitting a big black rectangle onto the surface.

But just for reference, you can clear a surface like this:

  DDBLTFX fx;
ZeroMemory(&fx, sizeof(fx));
fx.dwSize = sizeof(fx);
fx.dwFillColor = 0; // black

lpdds->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);


-Ironblayde
 Aeon Software

Next thing you know, they''ll take my thoughts away.
"Your superior intellect is no match for our puny weapons!"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.