Jump to content
  • Advertisement

Archived

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

m_red

DD Back Buffer

This topic is 5524 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
Advertisement
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
Ok, thanks.

I would have thought the tutorial I''m using would have told me that, it seems pretty necessary.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!