Code: Select all
LONG lRet = 1;
Code: Select all
LONG lRet = 0;
So guess what: both Win and GL Quake set hbrBackground to NULL, but neither handle WM_ERASEBKGND! Add this somewhere after your "switch (uMsg)":The DefWindowProc function erases the background by using the class background brush specified by the hbrBackground member of the WNDCLASS structure. If hbrBackground is NULL, the application should process the WM_ERASEBKGND message and erase the background.
Code: Select all
case WM_ERASEBKGND:
return 1;
(We're not really erasing the background, but we are drawing over it with our renderer.)An application should return nonzero if it erases the background; otherwise, it should return zero.
Neither of these will give you any performance gains by the way, there's no voodoo at work here. What they will do is make your program a better behaved citizen in Windows-land (and may help prevent odd behaviour on bad drivers).
While we're at it, and now that we've mentioned the WNDCLASS struct, find your VID_InitDIB function and set the correct class styles for OpenGL (GLQuake totally fails to do this):
Code: Select all
wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;