Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
DoZo1971's avatar
DoZo1971
Explorer
11 years ago

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():


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

3 Replies

  • Yes, something like that.
    But I'm not expert enough to handle all the peculiarities of all the different OpenGL versions.
    So I would end up with "some state", or "state that seems important for this particular project".
    I guess GLEW would be a good placeholder. I'll drop it at their mailing list.
  • We are working to resolve these issues with GL state changes in the next release of the SDK.

    I'll be sure that the engineers are aware of this specific case. Thanks.