oculus1
diff src/vr.cc @ 5:681046a82ed2
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 15 Sep 2013 05:01:38 +0300 |
parents | bb81990dc7c8 |
children | 3265970a7315 |
line diff
1.1 --- a/src/vr.cc Sun Sep 15 04:47:12 2013 +0300 1.2 +++ b/src/vr.cc Sun Sep 15 05:01:38 2013 +0300 1.3 @@ -21,8 +21,25 @@ 1.4 1.5 static bool init_ovr() 1.6 { 1.7 + LogMaskConstants log_level; 1.8 // initialize Oculus SDK 1.9 - System::Init(Log::ConfigureDefaultLog(LogMask_All)); 1.10 + const char *logenv = getenv("VR_LOGLEVEL"); 1.11 + if(logenv) { 1.12 + switch(atoi(logenv)) { 1.13 + case 0: 1.14 + log_level = LogMask_None; 1.15 + break; 1.16 + case 1: 1.17 + log_level = LogMask_Regular; 1.18 + break; 1.19 + case 2: 1.20 + default: 1.21 + log_level = LogMask_All; 1.22 + break; 1.23 + } 1.24 + } 1.25 + 1.26 + System::Init(Log::ConfigureDefaultLog(log_level)); 1.27 if(!(vr_ctx.ovr_devman = DeviceManager::Create())) { 1.28 fprintf(stderr, "failed to create OVR device manager\n"); 1.29 return false;