aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.h')
-rw-r--r--examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.h b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.h
index 44b79d9f51..ad53d5c8a5 100644
--- a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.h
+++ b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.h
@@ -55,14 +55,16 @@
#include <QMatrix4x4>
#include <QTimer>
-QT_FORWARD_DECLARE_CLASS(QOpenGLContext)
-QT_FORWARD_DECLARE_CLASS(QOpenGLFramebufferObject)
-QT_FORWARD_DECLARE_CLASS(QOffscreenSurface)
-QT_FORWARD_DECLARE_CLASS(QQuickRenderControl)
-QT_FORWARD_DECLARE_CLASS(QQuickWindow)
-QT_FORWARD_DECLARE_CLASS(QQmlEngine)
-QT_FORWARD_DECLARE_CLASS(QQmlComponent)
-QT_FORWARD_DECLARE_CLASS(QQuickItem)
+QT_BEGIN_NAMESPACE
+class QOpenGLContext;
+class QOpenGLTexture;
+class QOffscreenSurface;
+class QQuickRenderControl;
+class QQuickWindow;
+class QQmlEngine;
+class QQmlComponent;
+class QQuickItem;
+QT_END_NAMESPACE
class CubeRenderer;
@@ -83,8 +85,8 @@ protected:
private slots:
void run();
- void createFbo();
- void destroyFbo();
+ void createTexture();
+ void destroyTexture();
void render();
void requestUpdate();
void handleScreenChange();
@@ -92,7 +94,7 @@ private slots:
private:
void startQuick(const QString &filename);
void updateSizes();
- void resizeFbo();
+ void resizeTexture();
QOpenGLContext *m_context;
QOffscreenSurface *m_offscreenSurface;
@@ -101,14 +103,13 @@ private:
QQmlEngine *m_qmlEngine;
QQmlComponent *m_qmlComponent;
QQuickItem *m_rootItem;
- QOpenGLFramebufferObject *m_fbo;
+ uint m_textureId;
+ QSize m_textureSize;
bool m_quickInitialized;
bool m_quickReady;
QTimer m_updateTimer;
CubeRenderer *m_cubeRenderer;
qreal m_dpr;
- bool m_onscreen;
- QSize m_onscreenSize;
};
#endif