My SwapBuffers() function now looks like this:
Code:
void Bitmaps::SwapBuffers()
{
InvalidateRgn(hwnd, NULL, false);
UpdateWindow(hwnd);
}
I clear the buffer in the WM_PAINT case after blitting to ps.hdc. Guess I don't need the UpdateWindow in there, huh? I just tried it without & it works the same.
But fill me in on the message pump idea. My message pump looks like this:
Code:
if (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE))
{
int result = GetMessage(&msg, 0, 0, 0);
if (!result)
{
gQuit=true;
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
I've tried out a number of different message pumps, and when they work they all lead to the same result. The one above used to work but maybe I need to do something different to handle all the paint messages?