OpenGL in DisplayConduit

Makes me a little nervous to read that… Mainly because Rhino makes extensive use of FBOs, so it’s extremely important that if you plan on using them, that you first query the GL system for what the current FBO is, save it, set your FBO, do your stuff, but then make sure to reset the current FBO back to the one you saved… otherwise, you can really mess up the display and viewports because the frame buffers are now incorrect or out-of-sync.

basically this:

GLint     crntFBO;

::glGetIntegerv(GL_FRAMEBUFFER_BINDING, &crntFBO); // save the current FBO that is bound...

::glBindFramebuffer(GL_FRAMEBUFFER, YOUR_FBO);
// do your stuff...
...
...

::glBindFramebuffer(GL_FRAMEBUFFER, crntFBO); // put the saved FBO back.

Please be conscious of any other kind of “buffer state” that you might be changing… if you do not save and restore them when using them, then you can really mess things up. Which means, you cannot just set them in one part of your plugin, and then assume they’re always set… you will need to always set them and restore them at the point you plan on using them…if that makes sense.

-Jeff