libgoatvr
diff src/vr.c @ 24:d659cbedde1d
works on linux with 0.4.4
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 14 Jan 2015 08:03:27 +0200 |
parents | 437fe32ac633 |
children | 7eea82cea9d2 |
line diff
1.1 --- a/src/vr.c Mon Jan 12 08:59:32 2015 +0200 1.2 +++ b/src/vr.c Wed Jan 14 08:03:27 2015 +0200 1.3 @@ -33,7 +33,7 @@ 1.4 int vr_init(void) 1.5 { 1.6 int i, nmodules; 1.7 - char *vrmod_env; 1.8 + char *env; 1.9 1.10 /* create the default options database */ 1.11 if(!defopt && (defopt = create_options())) { 1.12 @@ -42,7 +42,12 @@ 1.13 set_option_float(defopt, VR_IPD, DEF_IPD); 1.14 set_option_vec3f(defopt, VR_LEYE_OFFSET, -DEF_IPD * 0.5f, 0.0f, 0.0f); 1.15 set_option_vec3f(defopt, VR_REYE_OFFSET, DEF_IPD * 0.5f, 0.0f, 0.0f); 1.16 - set_option_int(defopt, VR_NULL_STEREO, 0); 1.17 + 1.18 + if((env = getenv("VR_NULL_STEREO")) && atoi(env)) { 1.19 + set_option_int(defopt, VR_NULL_STEREO, 1); 1.20 + } else { 1.21 + set_option_int(defopt, VR_NULL_STEREO, 0); 1.22 + } 1.23 } 1.24 1.25 if(vrm) { 1.26 @@ -64,8 +69,8 @@ 1.27 return -1; 1.28 } 1.29 1.30 - if((vrmod_env = getenv("VR_MODULE"))) { 1.31 - vr_use_module_named(vrmod_env); 1.32 + if((env = getenv("VR_MODULE"))) { 1.33 + vr_use_module_named(env); 1.34 } else { 1.35 vr_use_module(0); 1.36 }