42 #include <QtOpenGL/qgl.h> 43 #include <QtOpenGL/private/qgl_p.h> 44 #include <QtOpenGL/private/qglextensions_p.h> 45 #include <QtCore/qatomic.h> 199 #define ctx d->guard.context() 250 return d->usagePattern;
262 #if defined(QT_OPENGL_ES_1) 265 d->usagePattern = value;
269 d->actualUsagePattern = value;
271 d->usagePattern =
d->actualUsagePattern = value;
302 d->guard.setContext(ctx);
303 d->guard.setId(bufferId);
310 #define ctx d->guard.context() 320 return d->guard.id() != 0;
338 d->guard.setContext(0);
353 #if !defined(QT_OPENGL_ES) 382 qWarning(
"QGLBuffer::allocate(): buffer not created");
402 qWarning(
"QGLBuffer::allocate(): buffer not created");
440 qWarning(
"QGLBuffer::bind(): buffer not created");
446 d->guard.context())) {
448 qWarning(
"QGLBuffer::bind: buffer is not valid in the current context");
472 qWarning(
"QGLBuffer::release(): buffer not created");
501 #define ctx d->guard.context() 512 return d->guard.id();
515 #ifndef GL_BUFFER_SIZE 516 #define GL_BUFFER_SIZE 0x8764 557 qWarning(
"QGLBuffer::map(): buffer not created");
563 #ifdef QT_OPENGL_ES_2 588 qWarning(
"QGLBuffer::unmap(): buffer not created");
#define QT_END_NAMESPACE
This macro expands to.
The QAtomicInt class provides platform-independent atomic operations on integers. ...
Type
This enum defines the type of GL buffer object to create with QGLBuffer.
bool ref()
Atomically increments the value of this QAtomicInt.
bool read(int offset, void *data, int count)
Reads the count bytes in this buffer starting at offset into data.
void setUsagePattern(QGLBuffer::UsagePattern value)
Sets the usage pattern for this buffer object to value.
void * map(QGLBuffer::Access access)
Maps the contents of this buffer into the application's memory space and returns a pointer to it...
void write(int offset, const void *data, int count)
Replaces the count bytes of this buffer starting at offset with the contents of data.
QGLBuffer::Type type() const
Returns the type of buffer represented by this object.
bool create()
Creates the buffer object in the GL server.
void destroy()
Destroys this buffer object, including the storage being used in the GL server.
GLuint bufferId() const
Returns the GL identifier associated with this buffer; zero if the buffer has not been created...
#define glGetBufferParameteriv
static const QGLContext * currentContext()
Returns the current context, i.e.
bool qt_resolve_buffer_extensions(QGLContext *ctx)
static bool areSharing(const QGLContext *context1, const QGLContext *context2)
Returns true if context1 and context2 are sharing their GL resources such as textures, shader programs, etc; otherwise returns false.
bool unmap()
Unmaps the buffer after it was mapped into the application's memory space with a previous call to map...
#define QT_BEGIN_NAMESPACE
This macro expands to.
~QGLBuffer()
Destroys this buffer object, including the storage being used in the GL server.
UsagePattern
This enum defines the usage pattern of a QGLBuffer object.
int access(const char *, int)
The QGLContext class encapsulates an OpenGL rendering context.
bool deref()
Atomically decrements the value of this QAtomicInt.
QGLSharedResourceGuard guard
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
#define glGetBufferSubData
QGLBuffer::UsagePattern usagePattern() const
Returns the usage pattern for this buffer object.
Access
This enum defines the access mode for QGLBuffer::map().
QGLBuffer()
Constructs a new buffer object of type QGLBuffer::VertexBuffer.
QGLBufferPrivate(QGLBuffer::Type t)
bool isCreated() const
Returns true if this buffer has been created; false otherwise.
bool bind()
Binds the buffer associated with this object to the current GL context.
The QGLBuffer class provides functions for creating and managing GL buffer objects.
void release()
Releases the buffer associated with this object from the current GL context.
QGLBuffer & operator=(const QGLBuffer &other)
Assigns a shallow copy of other to this object.
int size() const
Returns the size of the data in this buffer, for reading operations.
void allocate(const void *data, int count)
Allocates count bytes of space to the buffer, initialized to the contents of data.
QGLBuffer::UsagePattern usagePattern
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QGLBuffer::UsagePattern actualUsagePattern