Workspace 6.21.5
|
#include <Rendering/OpenGL/wsglbufferobjectcacheitem.h>
Public Member Functions | |
void | allocate (const void *data, int count) |
Allocates the specified number of bytes to the GL buffer object, copying the provided source data into the buffer. Any pre-existing data in the buffer is deleted. | |
void | allocate (int count) |
Allocates the specified number of bytes to the GL buffer object. The data will be uninitialized. Any pre-existing data in the buffer is deleted. | |
bool | bind () |
template<typename T > | |
T * | bindAllocateAndMap (int size, QOpenGLBuffer::UsagePattern usage, QOpenGLBuffer::Access access) |
void | drawElements (quint64 arrayIndex) |
void | enableVertexArray (quint64 arrayIndex, quint64 glAttributeIndex) |
const WSGLElementArrayProperties & | getElementArrayProperties (quint64 index) |
const QString & | getId () const |
bool | getInvalidated () const |
const QDateTime & | getLastUpdated () const |
int | getNumElementArrays () const |
int | getNumVertexArrays () const |
const WSGLVertexArrayProperties & | getVertexArrayProperties (quint64 index) |
GLuint | glBufferId () const |
bool | isGlBufferCreated () const |
bool | isMapped () const |
void * | map (QOpenGLBuffer::Access access) |
bool | read (int offset, void *data, int count) |
void | setElementArrayProperties (quint64 arrayIndex, GLenum type, quint64 minIndex, quint64 maxIndex, quint64 numElements, GLenum dataType, quint64 drawCount=0) |
void | setInvalidated (bool b) |
void | setLastUpdated (const QDateTime &timeStamp) |
void | setUsagePattern (QOpenGLBuffer::UsagePattern value) |
void | setVertexArrayProperties (quint64 arrayIndex, quint64 offset, quint64 numComponentsPerAttribute, quint64 componentSize, quint64 stride, GLenum glDataType, bool normalized) |
int | size () const |
QOpenGLBuffer::Type | type () const |
void | unbind () |
bool | unmap () |
QOpenGLBuffer::UsagePattern | usagePattern () const |
void | write (int offset, const void *data, int count) |
Protected Member Functions | |
bool | createGLBuffer () |
Cache items are only created by the Cache. Cache items are responsible for adding themselves to the cache when created, and storing an iterator. Cache items are responsible for removing themselves from the cache when deleted, using the stored iterator.
void allocate | ( | const void * | data, |
int | count | ||
) |
WSGLCacheCapacityExceededException | thrown if there is no capacity available in the cache for this allocation. The allocation will not occur. |
data | The source data to copy into the buffer. |
count | The number of bytes to allocate in the buffer. |
void allocate | ( | int | count | ) |
WSGLCacheCapacityExceededException | thrown if there is no capacity available in the cache for this allocation. The allocation will not occur. |
count | The number of bytes to allocate in the buffer. |
bool bind | ( | ) |
T * bindAllocateAndMap | ( | int | size, |
QOpenGLBuffer::UsagePattern | usage, | ||
QOpenGLBuffer::Access | access | ||
) |
Binds, allocates and maps a buffer into memory for local use.
size | Num bytes to allocate |
usage | Usage pattern for the buffer |
access | Access rights to the mapped buffer |
|
protected |
Creates the internal GL buffer associated with the cache item. Only the WSGLBufferObjectCache should ever call this method. createGLBuffer will only fail if the current GL context is invalid, or the system doesn't support OpenGL buffer objects.
void drawElements | ( | quint64 | arrayIndex | ) |
void enableVertexArray | ( | quint64 | arrayIndex, |
quint64 | glAttributeIndex | ||
) |
const WSGLElementArrayProperties & getElementArrayProperties | ( | quint64 | index | ) |
const QString & getId | ( | ) | const |
bool getInvalidated | ( | ) | const |
const QDateTime & getLastUpdated | ( | ) | const |
int getNumElementArrays | ( | ) | const |
int getNumVertexArrays | ( | ) | const |
const WSGLVertexArrayProperties & getVertexArrayProperties | ( | quint64 | index | ) |
GLuint glBufferId | ( | ) | const |
bool isGlBufferCreated | ( | ) | const |
bool isMapped | ( | ) | const |
void * map | ( | QOpenGLBuffer::Access | access | ) |
bool read | ( | int | offset, |
void * | data, | ||
int | count | ||
) |
void setElementArrayProperties | ( | quint64 | arrayIndex, |
GLenum | type, | ||
quint64 | minIndex, | ||
quint64 | maxIndex, | ||
quint64 | numElements, | ||
GLenum | dataType, | ||
quint64 | drawCount = 0 |
||
) |
void setInvalidated | ( | bool | b | ) |
b | Flag indicating the state of whether or not this cache item is invalidated. |
If b is true, all dependencies are also marked as invalidated to ensure they are also rebuilt the next time they are needed. If it is false, dependencies are not marked as not invalidated. This is because the caller should have already ensured that dependent items have been marked before calling this function (they are responsible for how dependent items are updated, so only they can ensure this occurs).
void setLastUpdated | ( | const QDateTime & | timeStamp | ) |
void setUsagePattern | ( | QOpenGLBuffer::UsagePattern | value | ) |
void setVertexArrayProperties | ( | quint64 | index, |
quint64 | offset, | ||
quint64 | numComponentsPerAttribute, | ||
quint64 | componentSize, | ||
quint64 | stride, | ||
GLenum | glDataType, | ||
bool | normalized | ||
) |
Sets the properties of the indexed vertex array information associated with this buffer object.
int size | ( | ) | const |
QOpenGLBuffer::Type type | ( | ) | const |
void unbind | ( | ) |
bool unmap | ( | ) |
QOpenGLBuffer::UsagePattern usagePattern | ( | ) | const |
void write | ( | int | offset, |
const void * | data, | ||
int | count | ||
) |