Another "hidden" OpenGL state change in OculusSDK 0.3.1
Hi,
After a call to ovrHmd_EndFrame(), the vertex arrays in my own render loop no longer showed up.
Took me another hour to find that glBindBuffer(GL_ARRAY_BUFFER, ...) kept its specific binding.
This is now my code surrounding ovrHmd_EndFrame():
Does anyone have / know of some kind of OpenGL state snapshot functionality so that I can take a before / after "picture" and compare the two?
Thanks,
Daniel Dekkers
After a call to ovrHmd_EndFrame(), the vertex arrays in my own render loop no longer showed up.
Took me another hour to find that glBindBuffer(GL_ARRAY_BUFFER, ...) kept its specific binding.
This is now my code surrounding ovrHmd_EndFrame():
glDisable(GL_CULL_FACE); // Oculus wants CW orientations, avoid the problem by turning of culling...
glDisable(GL_DEPTH_TEST); // Nothing is drawn with depth test on...
ovrHmd_EndFrame(l_Hmd);
glBindBuffer(GL_ARRAY_BUFFER, 0); // Unbind GL_ARRAY_BUFFER for my own vertex arrays to work...
glEnable(GL_CULL_FACE); // Turn back on...
glEnable(GL_DEPTH_TEST); // Turn back on...
glClearDepth(1); // Oculus set this to 0 (the near plane), return to normal...
glUseProgramObjectARB(0); // Oculus shader is still active, turn it off...
Does anyone have / know of some kind of OpenGL state snapshot functionality so that I can take a before / after "picture" and compare the two?
Thanks,
Daniel Dekkers
