qopenglwidget.sip 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // qopenglwidget.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtOpenGLWidgets 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 QOpenGLWidget : public QWidget
  22. {
  23. %TypeHeaderCode
  24. #include <qopenglwidget.h>
  25. %End
  26. %ConvertToSubClassCode
  27. static struct class_graph {
  28. const char *name;
  29. sipTypeDef **type;
  30. int yes, no;
  31. } graph[] = {
  32. {sipName_QOpenGLWidget, &sipType_QOpenGLWidget, -1, -1},
  33. };
  34. int i = 0;
  35. sipType = NULL;
  36. do
  37. {
  38. struct class_graph *cg = &graph[i];
  39. if (cg->name != NULL && sipCpp->inherits(cg->name))
  40. {
  41. sipType = *cg->type;
  42. i = cg->yes;
  43. }
  44. else
  45. i = cg->no;
  46. }
  47. while (i >= 0);
  48. %End
  49. public:
  50. QOpenGLWidget(QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags());
  51. virtual ~QOpenGLWidget();
  52. void setFormat(const QSurfaceFormat &format);
  53. QSurfaceFormat format() const;
  54. bool isValid() const;
  55. void makeCurrent();
  56. %If (Qt_6_5_0 -)
  57. void makeCurrent(QOpenGLWidget::TargetBuffer targetBuffer);
  58. %End
  59. void doneCurrent();
  60. QOpenGLContext *context() const;
  61. GLuint defaultFramebufferObject() const;
  62. %If (Qt_6_5_0 -)
  63. GLuint defaultFramebufferObject(QOpenGLWidget::TargetBuffer targetBuffer) const;
  64. %End
  65. QImage grabFramebuffer();
  66. %If (Qt_6_5_0 -)
  67. QImage grabFramebuffer(QOpenGLWidget::TargetBuffer targetBuffer);
  68. %End
  69. signals:
  70. void aboutToCompose();
  71. void frameSwapped();
  72. void aboutToResize();
  73. void resized();
  74. protected:
  75. virtual void initializeGL();
  76. virtual void resizeGL(int w, int h);
  77. virtual void paintGL();
  78. virtual void paintEvent(QPaintEvent *e);
  79. virtual void resizeEvent(QResizeEvent *e);
  80. virtual bool event(QEvent *e);
  81. virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
  82. virtual QPaintEngine *paintEngine() const;
  83. public:
  84. enum UpdateBehavior
  85. {
  86. NoPartialUpdate,
  87. PartialUpdate,
  88. };
  89. void setUpdateBehavior(QOpenGLWidget::UpdateBehavior updateBehavior);
  90. QOpenGLWidget::UpdateBehavior updateBehavior() const;
  91. GLenum textureFormat() const;
  92. void setTextureFormat(GLenum texFormat);
  93. %If (Qt_6_5_0 -)
  94. enum TargetBuffer
  95. {
  96. LeftBuffer,
  97. RightBuffer,
  98. };
  99. %End
  100. %If (Qt_6_5_0 -)
  101. QOpenGLWidget::TargetBuffer currentTargetBuffer() const;
  102. %End
  103. };