QGLBuffer Class
The QGLBuffer class provides functions for creating and managing GL buffer objects. More...
| Header: | #include <QGLBuffer> |
| qmake: | QT += opengl |
| Since: | Qt 4.7 |
This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
This class was introduced in Qt 4.7.
Public Types
| enum | Access { ReadOnly, WriteOnly, ReadWrite } |
| enum | Type { VertexBuffer, IndexBuffer, PixelPackBuffer, PixelUnpackBuffer } |
| enum | UsagePattern { StreamDraw, StreamRead, StreamCopy, StaticDraw, StaticRead, …, DynamicCopy } |
Detailed Description
Buffer objects are created in the GL server so that the client application can avoid uploading vertices, indices, texture image data, etc every time they are needed.
QGLBuffer objects can be copied around as a reference to the underlying GL buffer object:
QGLBuffer buffer1(QGLBuffer::IndexBuffer);
buffer1.create();
QGLBuffer buffer2 = buffer1;
QGLBuffer performs a shallow copy when objects are copied in this manner, but does not implement copy-on-write semantics. The original object will be affected whenever the copy is modified.
Note: This class has been deprecated in favor of QOpenGLBuffer.
Member Type Documentation
enum QGLBuffer::Access
This enum defines the access mode for QGLBuffer::map().
| Constant | Value | Description |
|---|---|---|
QGLBuffer::ReadOnly | 0x88B8 | The buffer will be mapped for reading only. |
QGLBuffer::WriteOnly | 0x88B9 | The buffer will be mapped for writing only. |
QGLBuffer::ReadWrite | 0x88BA | The buffer will be mapped for reading and writing. |
enum QGLBuffer::Type
This enum defines the type of GL buffer object to create with QGLBuffer.
| Constant | Value | Description |
|---|---|---|
QGLBuffer::VertexBuffer | 0x8892 | Vertex buffer object for use when specifying vertex arrays. |
QGLBuffer::IndexBuffer | 0x8893 | Index buffer object for use with glDrawElements(). |
QGLBuffer::PixelPackBuffer | 0x88EB | Pixel pack buffer object for reading pixel data from the GL server (for example, with glReadPixels()). Not supported under OpenGL/ES. |
QGLBuffer::PixelUnpackBuffer | 0x88EC | Pixel unpack buffer object for writing pixel data to the GL server (for example, with glTexImage2D()). Not supported under OpenGL/ES. |
enum QGLBuffer::UsagePattern
This enum defines the usage pattern of a QGLBuffer object.
| Constant | Value | Description |
|---|---|---|
QGLBuffer::StreamDraw | 0x88E0 | The data will be set once and used a few times for drawing operations. Under OpenGL/ES 1.1 this is identical to StaticDraw. |
QGLBuffer::StreamRead | 0x88E1 | The data will be set once and used a few times for reading data back from the GL server. Not supported under OpenGL/ES. |
QGLBuffer::StreamCopy | 0x88E2 | The data will be set once and used a few times for reading data back from the GL server for use in further drawing operations. Not supported under OpenGL/ES. |
QGLBuffer::StaticDraw | 0x88E4 | The data will be set once and used many times for drawing operations. |
QGLBuffer::StaticRead | 0x88E5 | The data will be set once and used many times for reading data back from the GL server. Not supported under OpenGL/ES. |
QGLBuffer::StaticCopy | 0x88E6 | The data will be set once and used many times for reading data back from the GL server for use in further drawing operations. Not supported under OpenGL/ES. |
QGLBuffer::DynamicDraw | 0x88E8 | The data will be modified repeatedly and used many times for drawing operations. |
QGLBuffer::DynamicRead | 0x88E9 | The data will be modified repeatedly and used many times for reading data back from the GL server. Not supported under OpenGL/ES. |
QGLBuffer::DynamicCopy | 0x88EA | The data will be modified repeatedly and used many times for reading data back from the GL server for use in further drawing operations. Not supported under OpenGL/ES. |