X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=vid_wgl.c;h=79505efd6d429ef06420c41744cb62560ad4704d;hb=7336d2cec9475abf5328ff1b0a07ad410057189f;hp=3c5614d69b0faaa56dd2789c3252a126c3d32e92;hpb=da29a8beeb35293e2fd38b51883c91b5cf4cf4ad;p=xonotic%2Fdarkplaces.git diff --git a/vid_wgl.c b/vid_wgl.c index 3c5614d6..79505efd 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -465,7 +465,7 @@ void Sys_SendKeyEvents (void) while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) { if (!GetMessage (&msg, NULL, 0, 0)) - Sys_Quit (); + Sys_Quit (1); TranslateMessage (&msg); DispatchMessage (&msg); @@ -618,7 +618,7 @@ LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_CLOSE: if (MessageBox (mainwindow, "Are you sure you want to quit?", "Confirm Exit", MB_YESNO | MB_SETFOREGROUND | MB_ICONQUESTION) == IDYES) - Sys_Quit (); + Sys_Quit (0); break; @@ -688,7 +688,7 @@ static int GL_OpenLibrary(const char *name) Con_Printf("Unable to LoadLibrary %s\n", name); return false; } - strcpy(gl_driver, name); + strlcpy(gl_driver, name, sizeof(gl_driver)); return true; } @@ -728,7 +728,7 @@ void VID_Init(void) IN_Init(); } -int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrate) +int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer) { int i; HDC hdc; @@ -776,6 +776,9 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrat pfd.cAlphaBits = 0; } + if (stereobuffer) + pfd.dwFlags |= PFD_STEREO; + gldrivername = "opengl32.dll"; // COMMANDLINEOPTION: Windows WGL: -gl_driver 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"); @@ -862,7 +865,7 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrat mainwindow = CreateWindowEx (ExWindowStyle, "DarkPlacesWindowClass", gamename, WindowStyle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, global_hInstance, NULL); if (!mainwindow) { - Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %d, %p) failed\n", ExWindowStyle, "DarkPlacesWindowClass", gamename, WindowStyle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, global_hInstance, NULL); + Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %d, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), NULL, NULL, (int)global_hInstance, NULL); VID_Shutdown(); return false; } @@ -903,14 +906,14 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrat if ((pixelformat = ChoosePixelFormat(baseDC, &pfd)) == 0) { VID_Shutdown(); - Con_Printf("ChoosePixelFormat(%d, %p) failed\n", baseDC, &pfd); + Con_Printf("ChoosePixelFormat(%d, %p) failed\n", (int)baseDC, &pfd); return false; } if (SetPixelFormat(baseDC, pixelformat, &pfd) == false) { VID_Shutdown(); - Con_Printf("SetPixelFormat(%d, %d, %p) failed\n", baseDC, pixelformat, &pfd); + Con_Printf("SetPixelFormat(%d, %d, %p) failed\n", (int)baseDC, pixelformat, &pfd); return false; } @@ -931,7 +934,7 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrat if (!qwglMakeCurrent(baseDC, baseRC)) { VID_Shutdown(); - Con_Printf("wglMakeCurrent(%d, %d) failed\n", baseDC, baseRC); + Con_Printf("wglMakeCurrent(%d, %d) failed\n", (int)baseDC, (int)baseRC); return false; } @@ -1171,7 +1174,7 @@ IN_StartupMouse */ static void IN_StartupMouse (void) { - if (COM_CheckParm ("-nomouse") || COM_CheckParm("-safe")) + if (COM_CheckParm ("-nomouse")) return; mouseinitialized = true; @@ -1348,7 +1351,7 @@ static void IN_StartupJoystick (void) // abort startup if user requests no joystick // COMMANDLINEOPTION: Windows Input: -nojoy disables joystick support, may be a small speed increase - if (COM_CheckParm ("-nojoy") || COM_CheckParm("-safe")) + if (COM_CheckParm ("-nojoy")) return; // verify joystick driver is present