diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qsurfaceformat.cpp | 26 | ||||
-rw-r--r-- | src/gui/kernel/qsurfaceformat.h | 10 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp index cc6b621047..ecfeb80149 100644 --- a/src/gui/kernel/qsurfaceformat.cpp +++ b/src/gui/kernel/qsurfaceformat.cpp @@ -68,6 +68,7 @@ public: , stencilSize(-1) , swapBehavior(QSurfaceFormat::DefaultSwapBehavior) , numSamples(-1) + , renderableType(QSurfaceFormat::DefaultRenderableType) , profile(QSurfaceFormat::NoProfile) , major(2) , minor(0) @@ -85,6 +86,7 @@ public: stencilSize(other->stencilSize), swapBehavior(other->swapBehavior), numSamples(other->numSamples), + renderableType(other->renderableType), profile(other->profile), major(other->major), minor(other->minor) @@ -101,6 +103,7 @@ public: int stencilSize; QSurfaceFormat::SwapBehavior swapBehavior; int numSamples; + QSurfaceFormat::RenderableType renderableType; QSurfaceFormat::OpenGLContextProfile profile; int major; int minor; @@ -479,6 +482,29 @@ void QSurfaceFormat::setAlphaBufferSize(int size) } /*! + Sets the desired renderable type. + + Chooses between desktop OpenGL, OpenGL ES, and OpenVG. +*/ +void QSurfaceFormat::setRenderableType(RenderableType type) +{ + if (d->renderableType != type) { + detach(); + d->renderableType = type; + } +} + +/*! + Gets the renderable type. + + Chooses between desktop OpenGL, OpenGL ES, and OpenVG. +*/ +QSurfaceFormat::RenderableType QSurfaceFormat::renderableType() const +{ + return d->renderableType; +} + +/*! Sets the desired OpenGL context profile. This setting is ignored if the requested OpenGL version is diff --git a/src/gui/kernel/qsurfaceformat.h b/src/gui/kernel/qsurfaceformat.h index a4224bbedd..e8972aa8ca 100644 --- a/src/gui/kernel/qsurfaceformat.h +++ b/src/gui/kernel/qsurfaceformat.h @@ -68,6 +68,13 @@ public: TripleBuffer }; + enum RenderableType { + DefaultRenderableType = 0x0, + OpenGL = 0x1, + OpenGLES = 0x2, + OpenVG = 0x4 + }; + enum OpenGLContextProfile { NoProfile, CoreProfile, @@ -106,6 +113,9 @@ public: void setProfile(OpenGLContextProfile profile); OpenGLContextProfile profile() const; + void setRenderableType(RenderableType type); + RenderableType renderableType() const; + void setMajorVersion(int majorVersion); int majorVersion() const; |