]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_wgl.c
removed trailing comments on cvar declarations and Cmd_AddCommand calls
[xonotic/darkplaces.git] / vid_wgl.c
index c52d0d99e8bfd6bd24bfbd8a67eebe8d1478967f..d0954d01e4b4550da5611adc2a5bf0aefebb3cb2 100644 (file)
--- 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 <commctrl.h>
 #include <dinput.h>
 
-extern void S_BlockSound (void);
-extern void S_UnblockSound (void);
 extern HINSTANCE global_hInstance;
 
 
@@ -414,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;
@@ -690,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;
 }
 
@@ -730,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;
@@ -778,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 <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");
@@ -864,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;
        }
@@ -905,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;
        }
 
@@ -933,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;
        }