#47637 - sajiimori - Mon Jul 11, 2005 5:29 pm
Does DrawBackground() overwrite the whole screen with the background? If that's not what you want, then don't do it.
#47688 - Cearn - Tue Jul 12, 2005 12:17 pm
Remember the difference between double buffering and page flipping. Double buffering uses a separate buffer which is draw to and then copied to the display buffer. Page flipping uses two buffers (pages) and the simply switches between the two. Right now, you're using both at the same time, which is work, but is kind of redundant. Besides that, depending on the implementation of DrawSavedScreen() and SaveScreen(), double buffering may be very, very slow.
Assuming that PlotPixel alrady accounts for the bytes-vs-VRAM problem, what happens is that you write one pixel to one page, move, flip, then write the next frame to the other page. It's not overwriting, the pixel was never drawn in that frame in the first place. To fix that, write to both frames.
Or, since this is a laserbike game where you just add pixels but never really remove them except for starting a new game, just scrap the double buffering/page flipping altogether.
#47695 - masterlodi - Tue Jul 12, 2005 12:50 pm
Hi Cearn,
Thanks for clarifying the matter. I will drop the double buffering/page flipping!!
Thanks again!