From 8be4b87a9740229f09b1dc2b7265e3e73c4397dd Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 7 Aug 2014 00:05:47 +0200 Subject: Bug 1021: Fix OculusVR detection, need to probe HMD count, otherwise native SDK code crashes w/ NPE --- .../classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/oculusvr') 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 -- cgit v1.2.3