X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=vid_wgl.c;h=d0954d01e4b4550da5611adc2a5bf0aefebb3cb2;hb=292da652050c1957bbee941051e358327f44f3b9;hp=a567a84efaa472f7a74c68feceac8a4c5354ffb3;hpb=4ee3e3c6cf65e316a2caa9a1cd4a12297980c253;p=xonotic%2Fdarkplaces.git diff --git a/vid_wgl.c b/vid_wgl.c index a567a84e..d0954d01 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -30,8 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -extern void S_BlockSound (void); -extern void S_UnblockSound (void); extern HINSTANCE global_hInstance; @@ -285,8 +283,11 @@ void VID_Finish (qboolean allowmousegrab) if (r_render.integer && !vid_hidden) { + CHECKGLERROR if (r_speeds.integer || gl_finish.integer) - qglFinish(); + { + qglFinish();CHECKGLERROR + } SwapBuffers(baseDC); } @@ -411,7 +412,7 @@ void AppActivate(BOOL fActive, BOOL minimize) * ****************************************************************************/ { - static BOOL sound_active; + static qboolean sound_active = false; // initially blocked by Sys_InitConsole() vid_activewindow = fActive; vid_hidden = minimize; @@ -687,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; } @@ -727,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; @@ -775,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"); @@ -861,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; } @@ -902,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; } @@ -930,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; }