X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=context.cpp;h=6ce57446b08983c670a3c7b7c99aaf452cc0fe61;hb=3cafda5de945dd02d321634abd61aa1e261f2384;hp=946d40dc84ab1b0c5462311f6e4bdf1af3355f10;hpb=95295bd41bc711bbc450ac6f5ccc68e64fefffa3;p=nageru diff --git a/context.cpp b/context.cpp index 946d40d..6ce5744 100644 --- a/context.cpp +++ b/context.cpp @@ -1,10 +1,11 @@ #include -#include -#include +#include #include -#include -#include +#include +#include + +class QSurface; QGLWidget *global_share_widget = nullptr; @@ -21,10 +22,11 @@ QSurface *create_surface(const QSurfaceFormat &format) return surface; } -QOpenGLContext *create_context() +QOpenGLContext *create_context(const QSurface *surface) { QOpenGLContext *context = new QOpenGLContext; context->setShareContext(global_share_widget->context()->contextHandle()); + context->setFormat(surface->format()); context->create(); return context; }