View Full Version : issues using two openGL contexts

02-19-2010, 04:11 AM

I'm developing a plug-in for a commercial software. My plug-in existed as a stand alone application drawing things using openGL 1.5 through QT with a qglwidget. Drawing in the mother application can by achieved using 2 different ways :
1) I can directly draw in the openGL context of the application. It calls my paintGL when needed. Works pretty well. We called this way dynamic mode.
2) I can write into a bitmap-like buffer. We called this way static mode.

Unfortunately, all the features are not allowed using dynamic mode. So we use on the fly switching regarding to what we have to do.

The issue is when I use static, then switch to dynamic, the mother application cache is corrupted. I can see chunk of my textures. The drawing part of my application is fine.
I'm not 100% sure but in static mode we actually use a different openGL context. To verify this, I tried to use the textures created in the mother application context in the static mode drawing method. I couldn't as expected.
Then how can I corrupt openGL stuff of the mother application using drawing in another one ?

thx all,

ps : I disabled "Unified back/depth buffer" with which I had issues.