OculusVR: Fix eye-texture sizing issue, producing correct FOV

This commit is contained in:
Campbell Suter 2017-10-01 18:17:41 +13:00
parent da52de7f7f
commit b6b1687450
No known key found for this signature in database
GPG Key ID: 754A66CCF3F73C0F

View File

@ -252,6 +252,9 @@ public class OculusVR implements VRAPI {
System.out.println("step 7 - recenter"); System.out.println("step 7 - recenter");
ovr_RecenterTrackingOrigin(session); ovr_RecenterTrackingOrigin(session);
// Do this so others relying on our texture size get it correct.
findHMDTextureSize();
// throw new UnsupportedOperationException("Not yet implemented!"); // throw new UnsupportedOperationException("Not yet implemented!");
return true; return true;
} }
@ -327,8 +330,11 @@ public class OculusVR implements VRAPI {
@Override @Override
public void getRenderSize(Vector2f store) { public void getRenderSize(Vector2f store) {
store.x = resolutionW; if(!isInitialized()) {
store.y = resolutionH; throw new IllegalStateException("Cannot call getRenderSize() before initialized!");
}
store.x = textureW;
store.y = textureH;
} }
@Override @Override
@ -410,7 +416,6 @@ public class OculusVR implements VRAPI {
throw new UnsupportedOperationException("Cannot use LibOVR without compositor!"); throw new UnsupportedOperationException("Cannot use LibOVR without compositor!");
} }
findHMDTextureSize();
setupLayers(); setupLayers();
framebuffers = new FrameBuffer[2][]; framebuffers = new FrameBuffer[2][];