From 9b793d68226cc30e873aa027ffc74c0fc98c5514 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 17 Apr 2013 07:13:52 +0000 Subject: [PATCH] set vid_stereobuffer cvar based on whether GL_STEREO is true after setting the mode git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11943 d7cf8633-e32d-0410-b094-e92efae38249 --- glquake.h | 2 ++ vid_shared.c | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/glquake.h b/glquake.h index 1802909d..f925b83f 100644 --- 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 diff --git a/vid_shared.c b/vid_shared.c index 4cac85d8..b141908a 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -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; } -- 2.39.2