summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp1
-rw-r--r--src/gui/kernel/qplatformopenglcontext.cpp10
-rw-r--r--src/gui/kernel/qplatformopenglcontext.h2
3 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 8b2378788f..51b4a6a079 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -606,6 +606,7 @@ bool QOpenGLContext::create()
d->platformGLContext = QGuiApplicationPrivate::platformIntegration()->createPlatformOpenGLContext(this);
if (!d->platformGLContext)
return false;
+ d->platformGLContext->initialize();
d->platformGLContext->setContext(this);
if (!d->platformGLContext->isSharing())
d->shareContext = 0;
diff --git a/src/gui/kernel/qplatformopenglcontext.cpp b/src/gui/kernel/qplatformopenglcontext.cpp
index 527bfdd983..bf0dccd440 100644
--- a/src/gui/kernel/qplatformopenglcontext.cpp
+++ b/src/gui/kernel/qplatformopenglcontext.cpp
@@ -89,6 +89,16 @@ QPlatformOpenGLContext::~QPlatformOpenGLContext()
}
/*!
+ Called after a new instance is constructed. The default implementation does nothing.
+
+ Subclasses can use this function to perform additional initialization that relies on
+ virtual functions.
+ */
+void QPlatformOpenGLContext::initialize()
+{
+}
+
+/*!
Reimplement in subclass if your platform uses framebuffer objects for surfaces.
The default implementation returns 0.
diff --git a/src/gui/kernel/qplatformopenglcontext.h b/src/gui/kernel/qplatformopenglcontext.h
index 261b6921a4..0a2bacfbde 100644
--- a/src/gui/kernel/qplatformopenglcontext.h
+++ b/src/gui/kernel/qplatformopenglcontext.h
@@ -63,6 +63,8 @@ public:
QPlatformOpenGLContext();
virtual ~QPlatformOpenGLContext();
+ virtual void initialize();
+
virtual QSurfaceFormat format() const = 0;
virtual void swapBuffers(QPlatformSurface *surface) = 0;