Skip to main content
gamedev.net
🔒 Locked

Screen Flickering

Started by Emagen 1 reply 400+ views
Original Post
Emagen
Emagen
Hi everybody - I have a directdraw program that blts a bitmap to the screen in windowed and fullscreen mode. The way I have it that it blts a black background using a ddbltfx, then I blt the bitmap to the screen, then it prints out some text using HDC, and then I either do a blt or a flip, depending whether it is in fullscreen or windowed mode. The program runs, but the screen flickers, I think it has to do with the blt or the flip at the end. Does anyone know how I can fix it so that it does not flicker. Thanks
VyvyanBasterd
VyvyanBasterd
OK, you have to make sure your backbuffer surface contains the same data as the primary surface when you flip it. Think of it this way:

Let''s say the backbuffer contains X, and the primary contains Y. If you continually call the flip (or simulate it in windowed mode), you will get XYXYXYXYXYXY...which''ll make a flicker between the two images.

So just Blt the data from the primary to the backbuffer. Better still, if the image is static, blt to the backbuffer, and then flip it only ONCE, and stop there.

Vyvyan
Emagen
Emagen
hi -

Do I need to create 2 different blts, one for windowed and one for fullscreen, where it blts to the backbuffer in fullscreen and blts to the primary in windowed?

Thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.