]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_agl.c
added vid_stereobuffer cvar based on patch from syschuck on the alientrap forums
[xonotic/darkplaces.git] / vid_agl.c
index 8a765011f38241ef3d58e785470b8f42a0205eda..de1775c235d5a0b53ff9fe86a5fc75fb0dc411b8 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -257,7 +257,7 @@ static int GL_OpenLibrary(void)
                Con_Printf("Unable to open symbol list for %s\n", name);
                return false;
        }
                Con_Printf("Unable to open symbol list for %s\n", name);
                return false;
        }
-       strcpy(gl_driver, name);
+       strlcpy(gl_driver, name, sizeof(gl_driver));
        return true;
 }
 
        return true;
 }
 
@@ -360,7 +360,7 @@ static void VID_ProcessPendingAsyncEvents (void)
                Sys_Quit();
 }
 
                Sys_Quit();
 }
 
-static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen)
+static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen, qboolean stereobuffer)
 {
        *attrib++ = AGL_RGBA;
        *attrib++ = AGL_RED_SIZE;*attrib++ = 1;
 {
        *attrib++ = AGL_RGBA;
        *attrib++ = AGL_RED_SIZE;*attrib++ = 1;
@@ -377,10 +377,12 @@ static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscr
        }
        if (fullscreen)
                *attrib++ = AGL_FULLSCREEN;
        }
        if (fullscreen)
                *attrib++ = AGL_FULLSCREEN;
+       if (stereobuffer)
+               *attrib++ = AGL_STEREO;
        *attrib++ = AGL_NONE;
 }
 
        *attrib++ = AGL_NONE;
 }
 
-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)
 {
     const EventTypeSpec winEvents[] =
        {
 {
     const EventTypeSpec winEvents[] =
        {
@@ -445,7 +447,7 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
                                                           GetEventTypeCount(winEvents), winEvents, window, NULL);
 
        // Create the desired attribute list
                                                           GetEventTypeCount(winEvents), winEvents, window, NULL);
 
        // Create the desired attribute list
-       VID_BuildAGLAttrib(attributes, bpp == 32, fullscreen);
+       VID_BuildAGLAttrib(attributes, bpp == 32, fullscreen, stereobuffer);
 
        if (!fullscreen)
        {
 
        if (!fullscreen)
        {