CStdGLCtxQt: share with Qt's global share context

This allows the OpenGL context that Qt creates for QOpenGLWidget to use the
GL objects that we created beforehand.
qteditor
Armin Burgmeier 2016-03-25 14:17:16 -07:00
parent 56545dc5f3
commit b6e573296a
1 changed files with 2 additions and 0 deletions

View File

@ -681,6 +681,8 @@ bool CStdGLCtxQt::Init(C4Window *window, C4AbstractApp *app)
surface = new QOffscreenSurface();
surface->create();
context = new QOpenGLContext();
QOpenGLContext* share_context = QOpenGLContext::globalShareContext();
if (share_context) context->setShareContext(share_context);
if (!context->create())
return false;