Qt5OpenGL: release context when finished

This commit is contained in:
wmayer
2017-03-11 16:28:26 +01:00
parent 0bec4dbd63
commit f8a14fc69e
4 changed files with 14 additions and 9 deletions

View File

@@ -110,6 +110,7 @@ bool GLPainter::end()
glPopAttrib();
glPopMatrix();
viewer->doneCurrent();
viewer = 0;
return true;
}

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -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)