diff options
author | Sven Gothel <[email protected]> | 2015-03-21 04:31:27 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-21 04:31:27 +0100 |
commit | 32fc8f3a64cfeee8936af98ae49f8e7c8dfe982f (patch) | |
tree | 9f4a250b235bcf6c41bd5c98f19c7e2666e45e57 /src/test | |
parent | 2c88b6dfd4eb7e2cd9a50fa48e08ecafc980931a (diff) |
Bug 1116 - Add OculusVR DK2 Support - Part-1 (DK2 on DK1 SDK w/o Eye Tracker)
- DK2's screen on X11 (at least) starts in rotated mode,
detect and apply MonitorDevice rotation via NEWT's OpenGL StereoDeviceUtil
- Move StereoDevice.Config -> StereoDeviceConfig
- Expose generic StereoDevice to public: GenericStereoDeviceConfig + GenericStereoDeviceFactory
- GenericStereoDeviceFactory exposes public GenericStereoDeviceConfig creation
for mono, sbs-stereo and lense-sbs-stereo w/ diff. parameters.
- Pass eye surface/texture size for each eye from device to renderer,
instead of assuming unified values.
- Unify GenericStereoDevice.createRenderer(..) and OVRStereoDevice.createRenderer(..) code
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java b/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java index 4f8fb3bd2..39ca85527 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java @@ -40,9 +40,12 @@ import com.jogamp.opengl.GLProfile; import jogamp.opengl.util.stereo.GenericStereoDevice; import com.jogamp.common.net.Uri; +import com.jogamp.newt.MonitorDevice; +import com.jogamp.newt.Screen; import com.jogamp.newt.event.KeyAdapter; import com.jogamp.newt.event.KeyEvent; import com.jogamp.newt.opengl.GLWindow; +import com.jogamp.newt.opengl.util.stereo.StereoDeviceUtil; import com.jogamp.opengl.math.FovHVHalves; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSBSStereo; @@ -249,15 +252,21 @@ public class StereoDemo01 { // // // - final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxProgrammable(true /* favorHardwareRasterizer */)); - final GLWindow window = GLWindow.create(caps); - final PointImmutable devicePos = stereoDevice.getPosition(); final DimensionImmutable deviceRes = stereoDevice.getSurfaceSize(); + System.err.println("Device Res "+deviceRes+", reqRotation "+stereoDevice.getRequiredRotation()); + System.err.println("Device Pos "+devicePos); + + final MonitorDevice monitor = StereoDeviceUtil.getMonitorDevice(stereoDevice, true); + final Screen screen = monitor.getScreen(); + + final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxProgrammable(true /* favorHardwareRasterizer */)); + final GLWindow window = GLWindow.create(screen, caps); + if( useStereoScreen ) { window.setPosition(devicePos.getX(), devicePos.getY()); } - window.setSurfaceSize(deviceRes.getWidth(), deviceRes.getHeight()); // might be not correct .. + window.setSurfaceSize(deviceRes.getWidth(), deviceRes.getHeight()); window.setAutoSwapBufferMode(useAutoSwap); window.setUndecorated(true); @@ -361,6 +370,7 @@ public class StereoDemo01 { animator.stop(); } window.destroy(); + screen.removeReference(); // StereoDeviceUtil.getMonitorDevice(stereoDevice, true); stereoDevice.dispose(); } } |