1// qopenglwidget.sip generated by MetaSIP
2//
3// This file is part of the QtWidgets Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23%If (Qt_5_4_0 -)
24%If (PyQt_OpenGL)
25
26class QOpenGLWidget : QWidget
27{
28%TypeHeaderCode
29#include <qopenglwidget.h>
30%End
31
32public:
33    QOpenGLWidget(QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags());
34    virtual ~QOpenGLWidget();
35    void setFormat(const QSurfaceFormat &format);
36    QSurfaceFormat format() const;
37    bool isValid() const;
38    void makeCurrent();
39    void doneCurrent();
40    QOpenGLContext *context() const;
41    GLuint defaultFramebufferObject() const;
42    QImage grabFramebuffer();
43
44signals:
45    void aboutToCompose();
46    void frameSwapped();
47    void aboutToResize();
48    void resized();
49
50protected:
51    virtual void initializeGL();
52    virtual void resizeGL(int w, int h);
53    virtual void paintGL();
54    virtual void paintEvent(QPaintEvent *e);
55    virtual void resizeEvent(QResizeEvent *e);
56    virtual bool event(QEvent *e);
57    virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
58    virtual QPaintEngine *paintEngine() const;
59
60public:
61%If (Qt_5_5_0 -)
62
63    enum UpdateBehavior
64    {
65        NoPartialUpdate,
66        PartialUpdate,
67    };
68
69%End
70%If (Qt_5_5_0 -)
71    void setUpdateBehavior(QOpenGLWidget::UpdateBehavior updateBehavior);
72%End
73%If (Qt_5_5_0 -)
74    QOpenGLWidget::UpdateBehavior updateBehavior() const;
75%End
76%If (Qt_5_10_0 -)
77    GLenum textureFormat() const;
78%End
79%If (Qt_5_10_0 -)
80    void setTextureFormat(GLenum texFormat);
81%End
82};
83
84%End
85%End
86