Advertisement Jump to content
Sign in to follow this  
devrjason

Render problems

This topic is 4924 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!