From 1b1831500142c995137f5e4b1bc03d21aa08e1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 7 Sep 2011 10:31:03 +0200 Subject: 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 Reviewed-by: Paul Olav Tvete --- src/gui/opengl/qopenglframebufferobject.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/gui/opengl/qopenglframebufferobject.h') diff --git a/src/gui/opengl/qopenglframebufferobject.h b/src/gui/opengl/qopenglframebufferobject.h index b7c38479ff9..8c3895b2934 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 d_ptr; -- cgit v1.2.3