Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qopenglwindow.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOPENGLWINDOW_H
5#define QOPENGLWINDOW_H
6
7#include <QtOpenGL/qtopenglglobal.h>
8
9#ifndef QT_NO_OPENGL
10
11#include <QtGui/QPaintDeviceWindow>
12#include <QtGui/QOpenGLContext>
13#include <QtGui/QImage>
14
16
18
19class Q_OPENGL_EXPORT QOpenGLWindow : public QPaintDeviceWindow
20{
22 Q_DECLARE_PRIVATE(QOpenGLWindow)
23
24public:
30
31 explicit QOpenGLWindow(UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = nullptr);
32 explicit QOpenGLWindow(QOpenGLContext *shareContext, UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = nullptr);
34
35 UpdateBehavior updateBehavior() const;
36 bool isValid() const;
37
38 void makeCurrent();
39 void doneCurrent();
40
41 QOpenGLContext *context() const;
42 QOpenGLContext *shareContext() const;
43
44 GLuint defaultFramebufferObject() const;
45
46 QImage grabFramebuffer();
47
50
51protected:
52 virtual void initializeGL();
53 virtual void resizeGL(int w, int h);
54 virtual void paintGL();
55 virtual void paintUnderGL();
56 virtual void paintOverGL();
57
58 void paintEvent(QPaintEvent *event) override;
59 void resizeEvent(QResizeEvent *event) override;
60 int metric(PaintDeviceMetric metric) const override;
61 QPaintDevice *redirected(QPoint *) const override;
62
63private:
64 Q_DISABLE_COPY(QOpenGLWindow)
65};
66
68
69#endif // QT_NO_OPENGL
70
71#endif
\inmodule QtGui
Definition qimage.h:37
\inmodule QtGui
\inmodule QtOpenGL
UpdateBehavior
This enum describes the update strategy of the QOpenGLWindow.
void frameSwapped()
This signal is emitted after the potentially blocking \l{QOpenGLContext::swapBuffers()}{buffer swap} ...
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:486
\inmodule QtCore\reentrant
Definition qpoint.h:25
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
\inmodule QtGui
Definition qwindow.h:63
void paintGL() override
[2]
Combined button and popup list for selecting options.
static void * context
GLfloat GLfloat GLfloat w
[0]
GLfloat GLfloat GLfloat GLfloat h
struct _cl_event * event
#define GLuint
#define Q_OBJECT
#define Q_SIGNALS