summaryrefslogtreecommitdiffstats
path: root/src/openglwidgets/qopenglwidget.h
diff options
context:
space:
mode:
authorKristoffer Skau <[email protected]>2022-10-27 15:38:53 +0200
committerKristoffer Skau <[email protected]>2022-11-28 19:12:27 +0100
commitee2dbcada81f5220a05414d7bf9d5eeebdda8972 (patch)
tree2bca1fc0c3569a98f26a0717d9e555a9b88f2364 /src/openglwidgets/qopenglwidget.h
parent8155bd54261688f333b2d68e2d76f0fc076a0fb4 (diff)
Add support for stereoscopic content in QOpenGLWidget
Need to add the plumbing necessary to support two textures in QOpenGLWidget and use these in the backing store. The changes required on the RHI level is already done in an earlier patch. Then paintGL() needs to be called twice, once for each buffer. Also add overloads for the other functions of QOopenGLWidget where it makes sense to query for left or right buffer. Then finally create an example. [ChangeLog][Widgets][QOpenGLWidget] Added support for stereoscopic rendering. Fixes: QTBUG-64587 Change-Id: I5a5c53506dcf8a56442097290dceb7eb730d50ce Reviewed-by: Laszlo Agocs <[email protected]>
Diffstat (limited to 'src/openglwidgets/qopenglwidget.h')
-rw-r--r--src/openglwidgets/qopenglwidget.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/openglwidgets/qopenglwidget.h b/src/openglwidgets/qopenglwidget.h
index edd731ae8ec..84097854e59 100644
--- a/src/openglwidgets/qopenglwidget.h
+++ b/src/openglwidgets/qopenglwidget.h
@@ -25,6 +25,11 @@ public:
PartialUpdate
};
+ enum TargetBuffer {
+ LeftBuffer = 0, // Default
+ RightBuffer // Only used when QSurfaceFormat::StereoBuffers is enabled
+ };
+
explicit QOpenGLWidget(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~QOpenGLWidget();
@@ -44,8 +49,12 @@ public:
QOpenGLContext *context() const;
GLuint defaultFramebufferObject() const;
+ GLuint defaultFramebufferObject(TargetBuffer targetBuffer) const;
QImage grabFramebuffer();
+ QImage grabFramebuffer(TargetBuffer targetBuffer);
+
+ TargetBuffer currentTargetBuffer() const;
Q_SIGNALS:
void aboutToCompose();