aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-08-07 00:05:47 +0200
committerSven Gothel <[email protected]>2014-08-07 00:05:47 +0200
commit8be4b87a9740229f09b1dc2b7265e3e73c4397dd (patch)
tree103873e8596cef03cdb912ea87136f4c4a46e169
parent5c1214b26ad6c877a9c0f8099a7fc2a230a8b245 (diff)
Bug 1021: Fix OculusVR detection, need to probe HMD count, otherwise native SDK code crashes w/ NPE
-rw-r--r--src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java
index ebd3699e1..b292c882d 100644
--- a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java
@@ -37,7 +37,10 @@ import com.jogamp.opengl.util.stereo.StereoDeviceFactory;
public class OVRStereoDeviceFactory extends StereoDeviceFactory {
public static boolean isAvailable() {
- return OVR.ovr_Initialize(); // recursive ..
+ if( OVR.ovr_Initialize() ) { // recursive ..
+ return 0 < OVR.ovrHmd_Detect();
+ }
+ return false;
}
@Override