Advertisement

Sprites flickering

Started by March 23, 2000 02:57 PM
2 comments, last by Pavel Krupets 24 years, 8 months ago
HELP!!! If sprite move slow it''s flickering. What I need to do to stop this flickering? Sprite move slow about 0.6 Pixel per 1/85 sec. LARGE_INTEGER Time; double Delta; QueryPerformanceCounter(&Time); Delta=(double)(Time.LowPart-g_aSpriteArray.m_uLastTickCount)/SS_MOVESPPED_H; I also use next to limit FPS (40fps) do { QueryPerformanceCounter(&TimeEnd); Diff=TimeEnd.LowPart-TimeStart.LowPart; } while(Diff<(1/40Sec));
The only real way to stop flickering is to use double buffering. Ie :

while(game_is_running){
gr_clear_screen();

gameplay_process_all();
gameplay_render_all();

gr_flip_buffers();

calc_frametime();
}

That''s about as basic as it gets. 99.99% of all retail games out there use almost exactly that.
Volition, Inc.
Advertisement
When using double buffering it is also a good idea to sync on the VSync of the monitor to avoid tearing. If using DirectX, this is in the SDK documentation.
I use DoubleBuffering... And sprites still flikering
Flip() in DirectX7 use VSynck by default

This topic is closed to new replies.

Advertisement