C# :: Mother Flicker!

Started by
12 comments, last by pimple 20 years, 6 months ago
@jperalta
even with GDI you can remove flickering. The technique is exactly like the one used by DirectDraw, use a secondary buffer.

@pimple
Flickers occur when the screen is updated before your game finishes its drawing. For example, your game is supposed to draw 100 bombs, but on the 10th bombs, for example, the screen refreshes. So, for x miliseconds you see 10 bombs, for the next x miliseconds you see 40 bombs, for the next next x miliseconds you see 100 bombs. This results in flickering. Especially that you use labels, everytime you update the contents of a label, C# will update the screen.

To remove it, you need to have a secondary buffer which is not displayed on the screen, but you can treat it as the monitor screen (it''s sometimes called Offscreen surface or Backbuffer). What you basically do is to draw everything on the secondary buffer, after everything is drawn, you update the screen by copying everything on the secondary buffer to the screen. See, the process of updating only occurs once, instead of 100 times.
Advertisement
oh, okay... thanks for the help!
here''s the "finished" version of my project:

http://www.mvhsbreakers.com/DodgeTheMatrix.zip

it still flickers, but i''ll try to fix that ASAP, since i now kno what to do (sort of)...
thanks again

Oh, BTW, some people (my friends) weren''t able to play the game... it failed to initialize... does anyone know why it runs fine in some machines, but not at all in others?

thanks yet again...
---Current project - Duck Hunt 2: Free at Last!http://www.duckhunt2.cjb.net
teh so-called .NET Framework?
yeah, that''s what i thought... thanks anyways...
---Current project - Duck Hunt 2: Free at Last!http://www.duckhunt2.cjb.net

This topic is closed to new replies.

Advertisement