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

Help with GDI back buffering

Started by Jazonxyz Apr 12, 2009 at 4:02 PM 0 replies 1k views
Original Post
Jazonxyz
Jazonxyz
I made a simple GDI based back buffer but for some reason, everything I do on it comes out black and white. Can you guys help me? Here's the code: http://rafb.net/p/p190og92.html
Colin Jeanne
Colin Jeanne
To start:

Do not call InvalidateRect() from WM_PAINT. Ever. InvalidateRect() will cause WM_PAINT to be placed in your message queue again, resulting in an endless loop of probably useless paints.

Do not use GetDC()/ReleaseDC() in WM_PAINT to acquire the DC you are drawing to. These will not clear the dirty rect for the DC. Use BeginPaint() and EndPaint().

Topic Locked

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

Sign in to reply to this topic.