1// qsurfaceformat.sip generated by MetaSIP
2//
3// This file is part of the QtGui 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
23class QSurfaceFormat
24{
25%TypeHeaderCode
26#include <qsurfaceformat.h>
27%End
28
29public:
30    enum FormatOption
31    {
32        StereoBuffers,
33        DebugContext,
34        DeprecatedFunctions,
35%If (Qt_5_5_0 -)
36        ResetNotification,
37%End
38    };
39
40    typedef QFlags<QSurfaceFormat::FormatOption> FormatOptions;
41
42    enum SwapBehavior
43    {
44        DefaultSwapBehavior,
45        SingleBuffer,
46        DoubleBuffer,
47        TripleBuffer,
48    };
49
50    enum RenderableType
51    {
52        DefaultRenderableType,
53        OpenGL,
54        OpenGLES,
55        OpenVG,
56    };
57
58    enum OpenGLContextProfile
59    {
60        NoProfile,
61        CoreProfile,
62        CompatibilityProfile,
63    };
64
65    QSurfaceFormat();
66    QSurfaceFormat(QSurfaceFormat::FormatOptions options);
67    QSurfaceFormat(const QSurfaceFormat &other);
68    ~QSurfaceFormat();
69    void setDepthBufferSize(int size);
70    int depthBufferSize() const;
71    void setStencilBufferSize(int size);
72    int stencilBufferSize() const;
73    void setRedBufferSize(int size);
74    int redBufferSize() const;
75    void setGreenBufferSize(int size);
76    int greenBufferSize() const;
77    void setBlueBufferSize(int size);
78    int blueBufferSize() const;
79    void setAlphaBufferSize(int size);
80    int alphaBufferSize() const;
81    void setSamples(int numSamples);
82    int samples() const;
83    void setSwapBehavior(QSurfaceFormat::SwapBehavior behavior);
84    QSurfaceFormat::SwapBehavior swapBehavior() const;
85    bool hasAlpha() const;
86    void setProfile(QSurfaceFormat::OpenGLContextProfile profile);
87    QSurfaceFormat::OpenGLContextProfile profile() const;
88    void setRenderableType(QSurfaceFormat::RenderableType type);
89    QSurfaceFormat::RenderableType renderableType() const;
90    void setMajorVersion(int majorVersion);
91    int majorVersion() const;
92    void setMinorVersion(int minorVersion);
93    int minorVersion() const;
94    void setStereo(bool enable);
95    void setOption(QSurfaceFormat::FormatOptions opt);
96    bool testOption(QSurfaceFormat::FormatOptions opt) const;
97    bool stereo() const;
98%If (Qt_5_1_0 -)
99    QPair<int, int> version() const;
100%End
101%If (Qt_5_1_0 -)
102    void setVersion(int major, int minor);
103%End
104%If (Qt_5_3_0 -)
105    void setOptions(QSurfaceFormat::FormatOptions options);
106%End
107%If (Qt_5_3_0 -)
108    void setOption(QSurfaceFormat::FormatOption option, bool on = true);
109%End
110%If (Qt_5_3_0 -)
111    bool testOption(QSurfaceFormat::FormatOption option) const;
112%End
113%If (Qt_5_3_0 -)
114    QSurfaceFormat::FormatOptions options() const;
115%End
116%If (Qt_5_3_0 -)
117    int swapInterval() const;
118%End
119%If (Qt_5_3_0 -)
120    void setSwapInterval(int interval);
121%End
122%If (Qt_5_4_0 -)
123    static void setDefaultFormat(const QSurfaceFormat &format);
124%End
125%If (Qt_5_4_0 -)
126    static QSurfaceFormat defaultFormat();
127%End
128%If (Qt_5_10_0 -)
129
130    enum ColorSpace
131    {
132        DefaultColorSpace,
133        sRGBColorSpace,
134    };
135
136%End
137%If (Qt_5_10_0 -)
138    QSurfaceFormat::ColorSpace colorSpace() const;
139%End
140%If (Qt_5_10_0 -)
141    void setColorSpace(QSurfaceFormat::ColorSpace colorSpace);
142%End
143};
144
145bool operator==(const QSurfaceFormat &, const QSurfaceFormat &);
146bool operator!=(const QSurfaceFormat &, const QSurfaceFormat &);
147QFlags<QSurfaceFormat::FormatOption> operator|(QSurfaceFormat::FormatOption f1, QFlags<QSurfaceFormat::FormatOption> f2);
148