Skip to main content
GameDev.net gamedev.net
🔒 Locked

GDI question

Started by Frank Black Nov 5, 2000 at 1:11 PM 2 replies 500+ views
Original Post
Frank Black
Frank Black
When I call InvalideRect() the screen flickers to much. Is it possible to work with 2 screen buffers in GDI like in DirectDraw? Or is there any other solution to the problem? Thanks.
Heraldin
Heraldin
I think your screen is flickering because it is being cleared between each frame. Try passing FALSE as the bErase argument to InvalidateRect(), or ignoring the WM_ERASEBKGND message in your window procedure.

Dave
bogdanontanu
bogdanontanu
Yes its possible to use a "backbuffer" even in GDI

this will eliminate flicker but many ppl dont know it

just make one or two memory DCs with a bitmap (large as your max window size) selected into it

do all blit on one of this buffers and the on wm_paint meassage blit the back buffer or the primary buffer (depend on how many buffers you have) to window''s DC (get a window DC by BeginPaint)

this will eliminate flicker and speed up scree redraw...

i found some examples on web also about this

Bogdan
obysoft
jwalker
jwalker
create another memory dc...

then blit whatever u want into it..

in your WM_PAINT..

use a paint_struct ... blit only the portion being re-drawn and dont draw the entire window at once.

Topic Locked

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

Sign in to reply to this topic.