Qt5OpenGL: release context when finished
This commit is contained in:
@@ -110,6 +110,7 @@ bool GLPainter::end()
|
||||
glPopAttrib();
|
||||
glPopMatrix();
|
||||
|
||||
viewer->doneCurrent();
|
||||
viewer = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -826,6 +826,8 @@ void QuarterWidget::paintEvent(QPaintEvent* event)
|
||||
if (w->doubleBuffer()) { w->swapBuffers(); }
|
||||
#endif
|
||||
|
||||
w->doneCurrent();
|
||||
|
||||
PRIVATE(this)->autoredrawenabled = true;
|
||||
|
||||
// process the delay queue the next time we enter this function,
|
||||
|
||||
@@ -1349,6 +1349,7 @@ void View3DInventorViewer::setRenderType(const RenderType type)
|
||||
framebuffer = fbo;
|
||||
}
|
||||
#endif
|
||||
gl->doneCurrent();
|
||||
}
|
||||
break;
|
||||
case Image:
|
||||
@@ -1390,6 +1391,7 @@ void View3DInventorViewer::setRenderType(const RenderType type)
|
||||
glImage = fbo.toImage(false);
|
||||
}
|
||||
#endif
|
||||
gl->doneCurrent();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -102,15 +102,6 @@ public:
|
||||
{
|
||||
SoContextHandler::addContextDestructionCallback(context_destruction_cb, this);
|
||||
|
||||
//SoBase::staticDataLock();
|
||||
static bool init = false;
|
||||
if (!init) {
|
||||
std::string ext = (const char*)(glGetString(GL_EXTENSIONS));
|
||||
vboAvailable = (ext.find("GL_ARB_vertex_buffer_object") != std::string::npos);
|
||||
init = true;
|
||||
}
|
||||
//SoBase::staticDataUnlock();
|
||||
|
||||
updateVbo = false;
|
||||
vboLoaded = false;
|
||||
indice_array = 0;
|
||||
@@ -451,6 +442,15 @@ void SoBrepFaceSet::renderColoredArray(SoMaterialBundle *const materials)
|
||||
#else
|
||||
void SoBrepFaceSet::GLRender(SoGLRenderAction *action)
|
||||
{
|
||||
//SoBase::staticDataLock();
|
||||
static bool init = false;
|
||||
if (!init) {
|
||||
std::string ext = (const char*)(glGetString(GL_EXTENSIONS));
|
||||
PRIVATE(this)->vboAvailable = (ext.find("GL_ARB_vertex_buffer_object") != std::string::npos);
|
||||
init = true;
|
||||
}
|
||||
//SoBase::staticDataUnlock();
|
||||
|
||||
if (this->coordIndex.getNum() < 3)
|
||||
return;
|
||||
if (this->selectionIndex.getNum() > 0)
|
||||
|
||||
Reference in New Issue
Block a user