X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=context.cpp;h=4736b82b8bbebcc0f6327d27acc132809af025f9;hb=7188db27a931607ed0388b10b351164c37cf04ee;hp=6ce57446b08983c670a3c7b7c99aaf452cc0fe61;hpb=ce8077a29627c7a55c5afdfdf5b56a4b179c7d62;p=nageru diff --git a/context.cpp b/context.cpp index 6ce5744..4736b82 100644 --- a/context.cpp +++ b/context.cpp @@ -22,6 +22,11 @@ QSurface *create_surface(const QSurfaceFormat &format) return surface; } +QSurface *create_surface_with_same_format(const QSurface *surface) +{ + return create_surface(surface->format()); +} + QOpenGLContext *create_context(const QSurface *surface) { QOpenGLContext *context = new QOpenGLContext; @@ -35,3 +40,8 @@ bool make_current(QOpenGLContext *context, QSurface *surface) { return context->makeCurrent(surface); } + +void delete_context(QOpenGLContext *context) +{ + delete context; +}