View Full Version : Flicker-Free animation in VB
vlovich
12-30-01, 11:31 AM
I am creating a simple Space Invaders game. However, when I create a starry background, the screen starts flickering because I have to CLS to get rid of stars to create an illusion of movement. What is the code for BitBlt or double buffering a bitmap? I've tried looking for a tutorial, but they were really confusing, and always part of a larger chunk of code and it was hard for me to tell well the usefull part was. Any help would be greatly appreciated.
hey there,
the answer to your question was right under your nose the whole time. Now, it's been like 5 years since the last time that I coded anything (except html), but what you are looking for is the blit command. I'm pretty sure that it is just "blit" and then your typical C++ stuff after it. Or, the other easiest way to correct this is to use page flipping. What page flipping does is while one image is on the screen the computer loads up a second image behind the first, then, when the program says "clear image" then the second image is ready to go right behind... tada. no flicker.
Hope that helped you out.
Loopin
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.