# HG changeset patch # User John Tsiombikas # Date 1411654444 -10800 # Node ID 3de7339841d0d1d940b31039a571bbec2f970e00 # Parent b2d902fff68d47559ae86ac22074572cb06676af option for the null module fallback presentation to show one or both eye views diff -r b2d902fff68d -r 3de7339841d0 src/vr.c --- a/src/vr.c Thu Sep 25 09:06:57 2014 +0300 +++ b/src/vr.c Thu Sep 25 17:14:04 2014 +0300 @@ -39,6 +39,7 @@ set_option_float(defopt, VR_RENDER_RES_SCALE, 1.0); set_option_float(defopt, VR_EYE_HEIGHT, 1.675); set_option_float(defopt, VR_IPD, 0.064); + set_option_int(defopt, VR_NULL_STEREO, 0); } if(vrm) { @@ -330,7 +331,7 @@ static void fallback_present(void) { - int i; + int i, show_both = vr_geti(VR_NULL_STEREO); glPushAttrib(GL_ENABLE_BIT | GL_TRANSFORM_BIT); @@ -350,8 +351,15 @@ glLoadIdentity(); for(i=0; i<2; i++) { - float x0 = i == 0 ? -1 : 0; - float x1 = i == 0 ? 0 : 1; + float x0, x1; + + if(show_both) { + x0 = i == 0 ? -1 : 0; + x1 = i == 0 ? 0 : 1; + } else { + x0 = -1; + x1 = 1; + } glBindTexture(GL_TEXTURE_2D, rtarg[i].tex); @@ -365,6 +373,8 @@ glTexCoord2f(rtarg[i].umin, rtarg[i].vmax); glVertex2f(x0, 1); glEnd(); + + if(!show_both) break; } glPopMatrix(); diff -r b2d902fff68d -r 3de7339841d0 src/vr.h --- a/src/vr.h Thu Sep 25 09:06:57 2014 +0300 +++ b/src/vr.h Thu Sep 25 17:14:04 2014 +0300 @@ -16,6 +16,8 @@ /* unit: meters */ #define VR_EYE_HEIGHT "eye-height" #define VR_IPD "ipd" +/* misc options */ +#define VR_NULL_STEREO "null-show-stereo" /* bool, default 0 */ enum { VR_EYE_LEFT,