Render problems

Started by
3 comments, last by GuitarPlayer0912 18 years, 8 months ago
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!
Advertisement
What are the problems with the graphics? Are they *flickering*?
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!
I think you need to try double buffering.
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".

This topic is closed to new replies.

Advertisement