diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-07 17:25:22 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-10 09:24:56 +0200 |
commit | 4a189c188ccd2fb5f8d1d5ddadf06cbd6bc0916f (patch) | |
tree | 99bff9f015e869b5521836ea5667590939b22a53 /src/gui/kernel/qwindow.h | |
parent | 4d10e64f2a78e32418a98e1c80c6579ae0779dfc (diff) |
QWindowContext / QWindowFormat refactor.
To enable having a single GL context used for multiple drawables we need
to de-couple the context class a bit more from the window class in the
plugin API. Now contexts are created stand-alone based on a GL format
and a share context, and when calling makeCurrent() a desired surface
is specified. This maps well to GLX, EGL, Cocoa, AGL, and WGL, which all
support this use case.
QWindowContext is renamed to QGuiGLContext, and QWindowFormat is renamed
to QGuiGLFormat. We have the ability to introduce a pbuffer or similar
other offscreen GL drawable abstraction in the future.
Diffstat (limited to 'src/gui/kernel/qwindow.h')
-rw-r--r-- | src/gui/kernel/qwindow.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index d1c48484ab..4356153683 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -44,7 +44,9 @@ #include <QtCore/QObject> #include <QtCore/QEvent> -#include <QtGui/qwindowformat_qpa.h> + +#include <QtGui/qguiglformat_qpa.h> +#include <QtGui/qwindowdefs.h> QT_BEGIN_HEADER @@ -64,8 +66,8 @@ class QMouseEvent; class QWheelEvent; #endif +class QPlatformGLSurface; class QPlatformWindow; -class QWindowContext; class QWindowSurface; class Q_GUI_EXPORT QWindow : public QObject @@ -100,9 +102,10 @@ public: Qt::WindowModality windowModality() const; void setWindowModality(Qt::WindowModality windowModality); - void setWindowFormat(const QWindowFormat &format); - QWindowFormat requestedWindowFormat() const; - QWindowFormat actualWindowFormat() const; + void setGLFormat(const QGuiGLFormat &format); + QGuiGLFormat glFormat() const; + + QPlatformGLSurface *glSurface() const; void setSurfaceType(SurfaceType type); SurfaceType surfaceType() const; @@ -137,8 +140,6 @@ public: void setWindowIcon(const QImage &icon) const; - QWindowContext *glContext() const; - void destroy(); QPlatformWindow *handle() const; |