uncontrolable flikering

Started by
5 comments, last by corner 16 years, 11 months ago
i cant get my unit to stop flickering every time i move it i have implemented double screen bufferin in my game what could it be
Advertisement
Quote:Original post by corner
i cant get my unit to stop flickering every time i move it i have implemented double screen bufferin in my game what could it be

Interesting guessing game :).

Ok, if only the unit flickers, you are drawing the screen without the unit between two positions.

For this to happen...

Are you drawing the unit over the same screen every time instead of drawing over the back one whichever it is? This is only possible is you implemented the double buffering manually.

Are you drawing the screen before and after drawing the unit?

Are you switching buffers twice for each draw?


im drawing to the screen buffer before it draws to the screen
Quote:Original post by corner
im drawing to the screen buffer before it draws to the screen

The thing is, if only a part of the screen flickers, then you must be showing the screen without that part some of the times (usually half).

Find the place where you draw the screen without the part (follow the code from the point where you render the screen to the point where you render the flickering part. If you never draw between those two points, you must be drawing a previous render to the screen at some point.
sounds like a znear and zfar plane issue? Try moving the znear further into the scene, and zfar to a suitable position
sounds like a znear and zfar plane issue? Try moving the znear further into the scene, and zfar to a suitable position
My game is a 2d and im using the allegro library in c++

This topic is closed to new replies.

Advertisement