forked from Mirrors/openclonk
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
parent
56545dc5f3
commit
b6e573296a
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue