]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
set vid_stereobuffer cvar based on whether GL_STEREO is true after setting the mode
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 17 Apr 2013 07:13:52 +0000 (07:13 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 19 Apr 2013 09:39:31 +0000 (11:39 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11943 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=9b793d68226cc30e873aa027ffc74c0fc98c5514

glquake.h
vid_shared.c

index 1802909d1abc4ba3b272c63cc67f4b1edd4a2331..f925b83f35ecf7be9649adff1127f2c0347922a1 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -99,6 +99,8 @@ typedef ptrdiff_t GLintptrARB;
 // int whose size is the same as a pointer (?)
 typedef ptrdiff_t GLsizeiptrARB;
 
+#define GL_STEREO                                      0x0C33
+
 #define GL_MODELVIEW                           0x1700
 #define GL_PROJECTION                          0x1701
 #define GL_TEXTURE                             0x1702
index 4cac85d809a12edb4eca4ab38c671365630107d2..b141908a1e55f071b7f7a50763a2f67cb5bf8e2a 100644 (file)
@@ -1840,6 +1840,22 @@ static int VID_Mode(int fullscreen, int width, int height, int bpp, float refres
                vid.sRGB2D         = vid_sRGB.integer >= 1 && vid.sRGBcapable2D;
                vid.sRGB3D         = vid_sRGB.integer >= 1 && vid.sRGBcapable3D;
 
+               switch(vid.renderpath)
+               {
+               case RENDERPATH_GL11:
+               case RENDERPATH_GL13:
+               case RENDERPATH_GL20:
+                       {
+                               GLboolean stereo;
+                               qglGetBooleanv(GL_STEREO, &stereo);
+                               vid.stereobuffer = stereo != 0;
+                       }
+                       break;
+               default:
+                       vid.stereobuffer = false;
+                       break;
+               }
+
                if(
                        (vid_sRGB_fallback.integer >= 3) // force fallback
                        ||
@@ -1860,7 +1876,7 @@ static int VID_Mode(int fullscreen, int width, int height, int bpp, float refres
                Cvar_SetValueQuick(&vid_samples, vid.mode.samples);
                if(vid_userefreshrate.integer)
                        Cvar_SetValueQuick(&vid_refreshrate, vid.mode.refreshrate);
-               Cvar_SetValueQuick(&vid_stereobuffer, vid.mode.stereobuffer);
+               Cvar_SetValueQuick(&vid_stereobuffer, vid.stereobuffer ? 1 : 0);
 
                return true;
        }