![]() |
Maria GDK 5.0.0.1005
Documentation of native code in develop branch
|
#include <StkBufferManager.h>
Public Member Functions | |
| void | createIndexPool (size_t initial_bytes, size_t min_block_bytes, GLenum usage=GL_DYNAMIC_DRAW) |
| BufferManager (const BufferManager &)=delete | |
| BufferManager & | operator= (const BufferManager &)=delete |
| void | createDefaultPools (size_t idx_initial_bytes, size_t idx_min_block_bytes, size_t vtx_initial_bytes, size_t vtx_min_block_bytes, GLenum usage=GL_DYNAMIC_DRAW) |
| void | createVertexPool (int vertex_type_bits, size_t initial_bytes, size_t min_block_bytes, GLenum usage=GL_DYNAMIC_DRAW) |
| std::shared_ptr< STK::VertexPool > | getVertexPool (int vertex_type_bits) const |
| std::shared_ptr< STK::IndexPool > | getIndexPool () const |
| ItemAllocation | allocate (int vertex_type_bits, size_t vertexCount, size_t indexCount=0) |
| void | uploadPositions (const ItemAllocation &a, const float *pos2f) |
| Upload vertex data for a given allocation. | |
| void | uploadNormals (const ItemAllocation &a, const float *pos2f) |
| Upload normal data for a given allocation. | |
| void | uploadTexCoords (const ItemAllocation &a, const float *pos2f) |
| Upload texture coordinate data for a given allocation. | |
| void | uploadIndices (const ItemAllocation &a, const uint32_t *indices) |
| Upload index data for a given allocation. | |
| void | drawArrays (const ItemAllocation &a, GLenum mode) |
| void | drawElements (const ItemAllocation &a, GLenum mode) |
| void | free (const ItemAllocation &a) |
Manager for shared VBOs, EBOs and VAOS. This buffer manager should be used for efficient allocation of vertex data It is currently geared towards 2D data for use in STK::GraphicsRender2D, but can be extended later.
| ItemAllocation STK::BufferManager::allocate | ( | int | vertex_type_bits, |
| size_t | vertexCount, | ||
| size_t | indexCount = 0 |
||
| ) |
Allocate vertices and indexes for the given vertex type configuration. Requires that the corresponding vertex pool has been set up.
| void STK::BufferManager::createDefaultPools | ( | size_t | idx_initial_bytes, |
| size_t | idx_min_block_bytes, | ||
| size_t | vtx_initial_bytes, | ||
| size_t | vtx_min_block_bytes, | ||
| GLenum | usage = GL_DYNAMIC_DRAW |
||
| ) |
| void STK::BufferManager::createIndexPool | ( | size_t | initial_bytes, |
| size_t | min_block_bytes, | ||
| GLenum | usage = GL_DYNAMIC_DRAW |
||
| ) |
Create a buffer pool for index data (EBOs). This must be done before you can use any vertex pools with the Index VertexType set.
| void STK::BufferManager::createVertexPool | ( | int | vertex_type_bits, |
| size_t | initial_bytes, | ||
| size_t | min_block_bytes, | ||
| GLenum | usage = GL_DYNAMIC_DRAW |
||
| ) |
Create a vertex pool. This creates a buffer pool for vertex data (VBOs). It also creates a corresponding VAO with the VBOs and possibly an EBO tied to the common IndexPool. The vertex type bits determine which VBOs to create and if it should use the Index EBO.