Archived

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

DD Back Buffer

This topic is 5306 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

Hello, I''m making a program using direct draw. In the program I bltfast a surface to the back buffer, flip, etc. My problem is that after I flip the image is still on the back buffer (it seems), so if I blt it, flip, and blt to a new possistion, instead of being one image (and having it move) there are two. I''m just doing basic stuff, like bltfast and flip. Is my code skrewed up or do I need to clear the buffer?

Share this post


Link to post
Share on other sites
clear that back buffer!
unless the ''blur'' effect is what you''re looking for you should be doing the following.


while(GameIsRunning)
clearBackBuffer();
Draw();
Flip();


~Rob

Share this post


Link to post
Share on other sites
You might try something like this, using the blitter to fill the screen with black. This is 8-bit code though.


void Surface::Fill (int nColor)
{
DDBLTFX ddbltfx;
DX_INIT_STRUCT (ddbltfx);
ddbltfx.dwFillColor = nColor;
lpSurface->Blt (NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
}

surface.Fill (0);

Jesus Saves

Share this post


Link to post
Share on other sites