diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-07-23 07:46:23 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-07-23 11:28:36 (GMT) |
commit | 699d74a9fae0b2d03e5c74bfb9590f6f0809ef4e (patch) | |
tree | b5a5b787558e74497b84dbcd73ff614e7642630f /src/gui/kernel/qplatformwindowformat_qpa.h | |
parent | be08fbc13f7370b6cc0c34660b4d1c16e4fdd3f5 (diff) | |
download | Qt-699d74a9fae0b2d03e5c74bfb9590f6f0809ef4e.zip Qt-699d74a9fae0b2d03e5c74bfb9590f6f0809ef4e.tar.gz Qt-699d74a9fae0b2d03e5c74bfb9590f6f0809ef4e.tar.bz2 |
Make it possible to have shared contexts to Lighthouse
This adds a getter to QPlatformGLContext for the "default shared
context". The setter is protected as it is the plugins responsibillity
to create it or not. QPlatformWindowFormat has also gotten a pointer to
a QPlatformGLContext for a non default shared context. Only implemented
shared contexts in testlite for now.
Diffstat (limited to 'src/gui/kernel/qplatformwindowformat_qpa.h')
-rw-r--r-- | src/gui/kernel/qplatformwindowformat_qpa.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gui/kernel/qplatformwindowformat_qpa.h b/src/gui/kernel/qplatformwindowformat_qpa.h index 3c5f907..37e628d 100644 --- a/src/gui/kernel/qplatformwindowformat_qpa.h +++ b/src/gui/kernel/qplatformwindowformat_qpa.h @@ -64,6 +64,7 @@ public: HasOverlay = 0x0100, SampleBuffers = 0x0200, DeprecatedFunctions = 0x0400, + UseDefaultSharedContext = 0x0800, SingleBuffer = DoubleBuffer << 16, NoDepthBuffer = DepthBuffer << 16, ColorIndex = Rgba << 16, @@ -74,7 +75,9 @@ public: IndirectRendering = DirectRendering << 16, NoOverlay = HasOverlay << 16, NoSampleBuffers = SampleBuffers << 16, - NoDeprecatedFunctions = DeprecatedFunctions << 16 + NoDeprecatedFunctions = DeprecatedFunctions << 16, + NoDefaultSharedContext = UseDefaultSharedContext << 16 + }; Q_DECLARE_FLAGS(FormatOptions, FormatOption) @@ -123,6 +126,9 @@ public: void setWindowApi(QPlatformWindowFormat::WindowApi api); WindowApi windowApi() const; + void setSharedContext(QPlatformGLContext *context); + QPlatformGLContext *sharedGLContext() const; + bool doubleBuffer() const; void setDoubleBuffer(bool enable); bool depth() const; @@ -139,6 +145,8 @@ public: void setStereo(bool enable); bool directRendering() const; void setDirectRendering(bool enable); + bool useDefaultSharedContext() const; + void setUseDefaultSharedContext(bool enable); // bool hasOverlay() const; // void setOverlay(bool enable); @@ -148,9 +156,6 @@ public: static QPlatformWindowFormat defaultFormat(); static void setDefaultFormat(const QPlatformWindowFormat& f); -// static QPlatformWindowFormat defaultOverlayFormat(); -// static void setDefaultOverlayFormat(const QPlatformWindowFormat& f); - private: QPlatformWindowFormatPrivate *d; @@ -215,6 +220,10 @@ inline bool QPlatformWindowFormat::sampleBuffers() const return testOption(QPlatformWindowFormat::SampleBuffers); } +inline bool QPlatformWindowFormat::useDefaultSharedContext() const +{ + return testOption(QPlatformWindowFormat::UseDefaultSharedContext); +} QT_END_NAMESPACE |