diff options
Diffstat (limited to 'src/oculusvr/classes/jogamp')
-rw-r--r-- | src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java | 14 | ||||
-rw-r--r-- | src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java | 5 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java index ffe1371a4..21d6cab7b 100644 --- a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java +++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java @@ -43,6 +43,10 @@ public class OVRStereoDeviceFactory extends StereoDeviceFactory { return false; } + private void dumpCaps(final ovrHmdDesc hmdDesc, final int deviceIndex) { + System.err.println(OVRVersion.getAvailableCapabilitiesInfo(hmdDesc, deviceIndex, null).toString()); + } + @Override public final StereoDevice createDevice(final int deviceIndex, final StereoDeviceConfig config, final boolean verbose) { final ovrHmdDesc hmdDesc = OVR.ovrHmd_Create(deviceIndex); @@ -53,10 +57,16 @@ public class OVRStereoDeviceFactory extends StereoDeviceFactory { } return null; } - final OVRStereoDevice ctx = new OVRStereoDevice(this, hmdDesc, deviceIndex); + final int hmdCaps = hmdDesc.getHmdCaps(); + if( 0 == ( hmdCaps & OVR.ovrHmdCap_ExtendDesktop ) ) { + System.err.println("Device "+deviceIndex+" is not in ExtendDesktop mode as required."); + dumpCaps(hmdDesc, deviceIndex); + return null; + } if( verbose ) { - System.err.println(OVRVersion.getAvailableCapabilitiesInfo(ctx.hmdDesc, deviceIndex, null).toString()); + dumpCaps(hmdDesc, deviceIndex); } + final OVRStereoDevice ctx = new OVRStereoDevice(this, hmdDesc, deviceIndex); return ctx; } } diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java index ff15d38d1..60fb8301e 100644 --- a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java +++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java @@ -386,6 +386,7 @@ public class OVRStereoDeviceRenderer implements StereoDeviceRenderer { private ShaderProgram sp; private ovrFrameTiming frameTiming; + private int frameCount; @Override public String toString() { @@ -440,6 +441,7 @@ public class OVRStereoDeviceRenderer implements StereoDeviceRenderer { eyes[1] = new OVREye(context.hmdDesc, this.distortionBits, eyePositionOffset, eyeRenderDescs[1], ovrTexture1Size, eyeViewports[1]); sp = null; frameTiming = null; + frameCount = 0; } @Override @@ -550,7 +552,7 @@ public class OVRStereoDeviceRenderer implements StereoDeviceRenderer { @Override public final void beginFrame(final GL gl) { - frameTiming = OVR.ovrHmd_BeginFrameTiming(context.hmdDesc, 0); + frameTiming = OVR.ovrHmd_BeginFrameTiming(context.hmdDesc, 0); // ovrHmd_GetFrameTiming not used, otherwise: frameCount); } @Override @@ -560,6 +562,7 @@ public class OVRStereoDeviceRenderer implements StereoDeviceRenderer { } OVR.ovrHmd_EndFrameTiming(context.hmdDesc); frameTiming = null; + frameCount++; } @Override |