diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-09-07 10:31:03 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2011-09-08 11:07:56 +0200 |
commit | 1b1831500142c995137f5e4b1bc03d21aa08e1e1 (patch) | |
tree | 5fcd21ee23c37fbe3466fde353d0bcfd09a051e2 /src/gui/opengl/qopenglframebufferobject.h | |
parent | 68974d8e647febb80a47d9cf6ce9452f3ce4fa21 (diff) |
Improved and made public the QOpenGLPaintDevice API.
The new API is more flexible, allowing the use of QOpenGLPaintDevice
with any QOpenGLContext, and putting more responsibility on the user for
ensuring the correct FBO is current (the user knows best anyhow).
Task-number: QTBUG-21263
Change-Id: I50b954125f552baef52fbb3fe2ed907a11ad519c
Reviewed-on: http://codereview.qt-project.org/4325
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
Diffstat (limited to 'src/gui/opengl/qopenglframebufferobject.h')
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.h b/src/gui/opengl/qopenglframebufferobject.h index b7c38479ff..8c3895b293 100644 --- a/src/gui/opengl/qopenglframebufferobject.h +++ b/src/gui/opengl/qopenglframebufferobject.h @@ -56,7 +56,7 @@ QT_MODULE(Gui) class QOpenGLFramebufferObjectPrivate; class QOpenGLFramebufferObjectFormat; -class Q_GUI_EXPORT QOpenGLFramebufferObject : public QPaintDevice +class Q_GUI_EXPORT QOpenGLFramebufferObject { Q_DECLARE_PRIVATE(QOpenGLFramebufferObject) public: @@ -92,6 +92,9 @@ public: bool bind(); bool release(); + int width() const { return size().width(); } + int height() const { return size().width(); } + GLuint texture() const; QSize size() const; QImage toImage() const; @@ -110,10 +113,6 @@ public: GLbitfield buffers = GL_COLOR_BUFFER_BIT, GLenum filter = GL_NEAREST); -protected: - int metric(PaintDeviceMetric metric) const; - int devType() const { return QInternal::FramebufferObject; } - private: Q_DISABLE_COPY(QOpenGLFramebufferObject) QScopedPointer<QOpenGLFramebufferObjectPrivate> d_ptr; |