]> git.sesse.net Git - nageru/blobdiff - context.cpp
Let the theme distinguish between fake and real inputs (ie., if there is an actual...
[nageru] / context.cpp
index 4ae85bdd95a7dc09f9abd4676d35fa078e894402..ea576cd73ff09e6756e0b141bd693d7db8b35239 100644 (file)
@@ -22,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;
 }
@@ -34,3 +35,8 @@ bool make_current(QOpenGLContext *context, QSurface *surface)
 {
        return context->makeCurrent(surface);
 }
+
+void delete_context(QOpenGLContext *context)
+{
+       delete context;
+}