qopenglbuffer.sip 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // qopenglbuffer.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtOpenGL 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 QOpenGLBuffer
  22. {
  23. %TypeHeaderCode
  24. #include <qopenglbuffer.h>
  25. %End
  26. public:
  27. enum Type
  28. {
  29. VertexBuffer,
  30. IndexBuffer,
  31. PixelPackBuffer,
  32. PixelUnpackBuffer,
  33. };
  34. QOpenGLBuffer();
  35. explicit QOpenGLBuffer(QOpenGLBuffer::Type type);
  36. QOpenGLBuffer(const QOpenGLBuffer &other);
  37. ~QOpenGLBuffer();
  38. enum UsagePattern
  39. {
  40. StreamDraw,
  41. StreamRead,
  42. StreamCopy,
  43. StaticDraw,
  44. StaticRead,
  45. StaticCopy,
  46. DynamicDraw,
  47. DynamicRead,
  48. DynamicCopy,
  49. };
  50. enum Access
  51. {
  52. ReadOnly,
  53. WriteOnly,
  54. ReadWrite,
  55. };
  56. QOpenGLBuffer::Type type() const;
  57. QOpenGLBuffer::UsagePattern usagePattern() const;
  58. void setUsagePattern(QOpenGLBuffer::UsagePattern value);
  59. bool create();
  60. bool isCreated() const;
  61. void destroy();
  62. bool bind();
  63. void release();
  64. static void release(QOpenGLBuffer::Type type);
  65. GLuint bufferId() const;
  66. int size() const /__len__/;
  67. bool read(int offset, void *data, int count);
  68. void write(int offset, const void *data, int count);
  69. void allocate(const void *data, int count);
  70. void allocate(int count);
  71. void *map(QOpenGLBuffer::Access access);
  72. bool unmap();
  73. enum RangeAccessFlag /BaseType=Flag/
  74. {
  75. RangeRead,
  76. RangeWrite,
  77. RangeInvalidate,
  78. RangeInvalidateBuffer,
  79. RangeFlushExplicit,
  80. RangeUnsynchronized,
  81. };
  82. typedef QFlags<QOpenGLBuffer::RangeAccessFlag> RangeAccessFlags;
  83. void *mapRange(int offset, int count, QOpenGLBuffer::RangeAccessFlags access);
  84. %If (Qt_6_5_0 -)
  85. void swap(QOpenGLBuffer &other);
  86. %End
  87. };