Sign in to follow this  

Render problems

This topic is 4527 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 made a small game like space invaders with 1 alien... but the graphics don't seem to render properly. I've read about drawing the graphics into a backbuffer... but I don't think that's necessary since I only have two graphics... It should work if I just wait for the VBLANK to draw shouldn't it? Here is a link to the source, please advise me on what changes I should make: http://wil.midco.net/jasons/bmsrc.zip Thanks!

Share this post


Link to post
Share on other sites
Depends on how you compile it and what machine you use.

When I compiled it with a port of GCC, I found both graphics flickering. When I compiled it with Visual Studio 6, I found the ship graphic didn't flicker, but left a trail of sorts when it moved, and the alien graphic was only drawn once in a while, if at all!

Share this post


Link to post
Share on other sites
Yeah, AsOne is right. You need to draw your graphics to an offscreen device context (I use hOffscreenDC) and then blit the images to the normal device context (screen). This prevents flickering because without double buffering, the graphics are erased and redrawn on the same screen, thus appearing to "flicker".
With an offscreen device context, the graphics are erased on that device context, and then redrawn to your normal device context, preventing the "flicker".

Share this post


Link to post
Share on other sites

This topic is 4527 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this