+//TODO: move it around in vid_wgl.c since I dont think this is the right position
+void Sys_SendKeyEvents (void)
+{
+ MSG msg;
+
+ while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
+ {
+ if (!GetMessage (&msg, NULL, 0, 0))
+ Sys_Quit ();
+
+ TranslateMessage (&msg);
+ DispatchMessage (&msg);
+ }
+}
+
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
/* main window procedure */
@@ -761,7+782,6 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp)
};
int pixelformat;
DWORD WindowStyle, ExWindowStyle;
- HGLRC baseRC;
int CenterX, CenterY;
const char *gldrivername;
int depth;
@@ -782,6+802,7 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp)
}
gldrivername = "opengl32.dll";
+// COMMANDLINEOPTION: Windows WGL: -gl_driver <drivername> selects a GL driver library, default is opengl32.dll, useful only for 3dfxogl.dll or 3dfxvgl.dll, if you don't know what this is for, you don't need it
i = COM_CheckParm("-gl_driver");
if (i && i < com_argc - 1)
gldrivername = com_argv[i + 1];
@@ -821,13+842,13 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp)
if (i & RC_PALETTE)
{
VID_Shutdown();
- Con_Printf ("Can't run in non-RGB mode\n");
+ Con_Print("Can't run in non-RGB mode\n");
return false;
}
if (bpp > depth)
{
VID_Shutdown();
- Con_Printf ("A higher desktop depth is required to run this video mode\n");
+ Con_Print("A higher desktop depth is required to run this video mode\n");
return false;
}
@@ -905,40+926,40 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp)
// fix the leftover Alt from any Alt-Tab or the like that switched us away
ClearAllStates ();
- hdc = GetDC(mainwindow);
+ baseDC = GetDC(mainwindow);
- if ((pixelformat = ChoosePixelFormat(hdc, &pfd)) == 0)
+ if ((pixelformat = ChoosePixelFormat(baseDC, &pfd)) == 0)