qsurfaceformat.sip 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // qsurfaceformat.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QSurfaceFormat
  22. {
  23. %TypeHeaderCode
  24. #include <qsurfaceformat.h>
  25. %End
  26. public:
  27. enum FormatOption /BaseType=Flag/
  28. {
  29. StereoBuffers,
  30. DebugContext,
  31. DeprecatedFunctions,
  32. ResetNotification,
  33. %If (Qt_6_2_0 -)
  34. ProtectedContent,
  35. %End
  36. };
  37. typedef QFlags<QSurfaceFormat::FormatOption> FormatOptions;
  38. enum SwapBehavior
  39. {
  40. DefaultSwapBehavior,
  41. SingleBuffer,
  42. DoubleBuffer,
  43. TripleBuffer,
  44. };
  45. enum RenderableType
  46. {
  47. DefaultRenderableType,
  48. OpenGL,
  49. OpenGLES,
  50. OpenVG,
  51. };
  52. enum OpenGLContextProfile
  53. {
  54. NoProfile,
  55. CoreProfile,
  56. CompatibilityProfile,
  57. };
  58. QSurfaceFormat();
  59. QSurfaceFormat(QSurfaceFormat::FormatOptions options);
  60. QSurfaceFormat(const QSurfaceFormat &other);
  61. ~QSurfaceFormat();
  62. void setDepthBufferSize(int size);
  63. int depthBufferSize() const;
  64. void setStencilBufferSize(int size);
  65. int stencilBufferSize() const;
  66. void setRedBufferSize(int size);
  67. int redBufferSize() const;
  68. void setGreenBufferSize(int size);
  69. int greenBufferSize() const;
  70. void setBlueBufferSize(int size);
  71. int blueBufferSize() const;
  72. void setAlphaBufferSize(int size);
  73. int alphaBufferSize() const;
  74. void setSamples(int numSamples);
  75. int samples() const;
  76. void setSwapBehavior(QSurfaceFormat::SwapBehavior behavior);
  77. QSurfaceFormat::SwapBehavior swapBehavior() const;
  78. bool hasAlpha() const;
  79. void setProfile(QSurfaceFormat::OpenGLContextProfile profile);
  80. QSurfaceFormat::OpenGLContextProfile profile() const;
  81. void setRenderableType(QSurfaceFormat::RenderableType type);
  82. QSurfaceFormat::RenderableType renderableType() const;
  83. void setMajorVersion(int majorVersion);
  84. int majorVersion() const;
  85. void setMinorVersion(int minorVersion);
  86. int minorVersion() const;
  87. void setStereo(bool enable);
  88. bool stereo() const;
  89. std::pair<int, int> version() const;
  90. void setVersion(int major, int minor);
  91. void setOptions(QSurfaceFormat::FormatOptions options);
  92. void setOption(QSurfaceFormat::FormatOption option, bool on = true);
  93. bool testOption(QSurfaceFormat::FormatOption option) const;
  94. QSurfaceFormat::FormatOptions options() const;
  95. int swapInterval() const;
  96. void setSwapInterval(int interval);
  97. static void setDefaultFormat(const QSurfaceFormat &format);
  98. static QSurfaceFormat defaultFormat();
  99. const QColorSpace &colorSpace() const;
  100. void setColorSpace(const QColorSpace &colorSpace);
  101. };
  102. bool operator==(const QSurfaceFormat &, const QSurfaceFormat &);
  103. bool operator!=(const QSurfaceFormat &, const QSurfaceFormat &);