#include <VboMesh.h>
|
void | buildVao (const GlslProgRef &shader, const AttribGlslMap &attributeMapping=AttribGlslMap()) |
|
void | buildVao (const GlslProg *shader, const AttribGlslMap &attributeMapping=AttribGlslMap()) |
|
uint32_t | getNumVertices () const |
|
uint32_t | getNumIndices () const |
|
GLenum | getGlPrimitive () const |
|
GLenum | getIndexDataType () const |
|
uint8_t | getAttribDims (geom::Attrib attr) const |
|
geom::AttribSet | getAvailableAttribs () const |
|
VboRef | getIndexVbo () |
|
std::vector< VboRef > | getVertexArrayVbos () |
|
const std::vector< std::pair< geom::BufferLayout, VboRef > > & | getVertexArrayLayoutVbos () const |
|
void | appendVbo (const geom::BufferLayout &layout, const VboRef &vbo) |
|
std::pair< geom::BufferLayout, VboRef > * | findAttrib (geom::Attrib attr) |
|
void | bufferAttrib (geom::Attrib attrib, size_t dataSizeBytes, const void *data) |
|
template<typename T > |
void | bufferAttrib (geom::Attrib attrib, const std::vector< T > &data) |
|
void | bufferIndices (size_t dataSizeBytes, const void *data) |
|
MappedAttrib< float > | mapAttrib1f (geom::Attrib attr, bool orphanExisting=true) |
|
MappedAttrib< vec2 > | mapAttrib2f (geom::Attrib attr, bool orphanExisting=true) |
|
MappedAttrib< vec3 > | mapAttrib3f (geom::Attrib attr, bool orphanExisting=true) |
|
MappedAttrib< vec4 > | mapAttrib4f (geom::Attrib attr, bool orphanExisting=true) |
|
void | drawImpl (GLint first=0, GLsizei count=-1) |
|
geom::SourceRef | createSource () const |
|
void | downloadIndices (uint32_t *dest) const |
|
void | echoVertexRange (std::ostream &os, size_t startIndex, size_t endIndex) |
|
void | echoIndexRange (std::ostream &os, size_t startIndex, size_t endIndex) |
|
|
static VboMeshRef | create (const geom::Source &source) |
|
static VboMeshRef | create (const geom::Source &source, const geom::AttribSet &requestedAttribs) |
|
static VboMeshRef | create (const geom::Source &source, const std::vector< VboMesh::Layout > &vertexArrayLayouts) |
|
static VboMeshRef | create (const geom::Source &source, const std::vector< std::pair< VboMesh::Layout, VboRef >> &vertexArrayLayouts, const VboRef &indexVbo=nullptr) |
|
static VboMeshRef | create (uint32_t numVertices, GLenum glPrimitive, const std::vector< std::pair< geom::BufferLayout, VboRef >> &vertexArrayBuffers, uint32_t numIndices=0, GLenum indexType=GL_UNSIGNED_SHORT, const VboRef &indexVbo=VboRef()) |
|
static VboMeshRef | create (uint32_t numVertices, GLenum glPrimitive, const std::vector< Layout > &vertexArrayLayouts, uint32_t numIndices=0, GLenum indexType=GL_UNSIGNED_SHORT, const VboRef &indexVbo=VboRef()) |
|
|
| VboMesh (const geom::Source &source, std::vector< std::pair< Layout, VboRef >> vertexArrayBuffers, const VboRef &indexArrayVbo) |
|
| VboMesh (uint32_t numVertices, uint32_t numIndices, GLenum glPrimitive, GLenum indexType, const std::vector< std::pair< geom::BufferLayout, VboRef >> &vertexArrayBuffers, const VboRef &indexVbo) |
|
| VboMesh (uint32_t numVertices, uint32_t numIndices, GLenum glPrimitive, GLenum indexType, const std::vector< Layout > &vertexArrayLayouts, const VboRef &indexVbo) |
|
void | allocateIndexVbo () |
|
void | echoVertices (std::ostream &os, const std::vector< uint32_t > &indices, bool printElements) |
|
template<typename T > |
MappedAttrib< T > | mapAttribImpl (geom::Attrib attr, int dims, bool orphanExisting) |
|
void | unmapVboImpl (const VboRef &vbo) |
|
cinder::gl::VboMesh::VboMesh |
( |
const geom::Source & |
source, |
|
|
std::vector< std::pair< Layout, VboRef >> |
vertexArrayBuffers, |
|
|
const VboRef & |
indexArrayVbo |
|
) |
| |
|
protected |
cinder::gl::VboMesh::VboMesh |
( |
uint32_t |
numVertices, |
|
|
uint32_t |
numIndices, |
|
|
GLenum |
glPrimitive, |
|
|
GLenum |
indexType, |
|
|
const std::vector< std::pair< geom::BufferLayout, VboRef >> & |
vertexArrayBuffers, |
|
|
const VboRef & |
indexVbo |
|
) |
| |
|
protected |
cinder::gl::VboMesh::VboMesh |
( |
uint32_t |
numVertices, |
|
|
uint32_t |
numIndices, |
|
|
GLenum |
glPrimitive, |
|
|
GLenum |
indexType, |
|
|
const std::vector< Layout > & |
vertexArrayLayouts, |
|
|
const VboRef & |
indexVbo |
|
) |
| |
|
protected |
Creates a VboMesh which represents the geom::Source source using 1 or more VboMesh::Layouts for vertex data.
Creates a VboMesh which represents the geom::Source source using 1 or more Vbo/VboMesh::Layout pairs. A null VboRef requests allocation.
static VboMeshRef cinder::gl::VboMesh::create |
( |
uint32_t |
numVertices, |
|
|
GLenum |
glPrimitive, |
|
|
const std::vector< std::pair< geom::BufferLayout, VboRef >> & |
vertexArrayBuffers, |
|
|
uint32_t |
numIndices = 0 , |
|
|
GLenum |
indexType = GL_UNSIGNED_SHORT , |
|
|
const VboRef & |
indexVbo = VboRef() |
|
) |
| |
|
static |
Creates a VboMesh which represents the user's vertex buffer objects. Allows optional indexVbo to enable indexed vertices; creates a static index VBO if none provided.
VboMeshRef cinder::gl::VboMesh::create |
( |
uint32_t |
numVertices, |
|
|
GLenum |
glPrimitive, |
|
|
const std::vector< Layout > & |
vertexArrayLayouts, |
|
|
uint32_t |
numIndices = 0 , |
|
|
GLenum |
indexType = GL_UNSIGNED_SHORT , |
|
|
const VboRef & |
indexVbo = VboRef() |
|
) |
| |
|
static |
Creates a VboMesh which represents the user's vertex buffer objects. Allows optional indexVbo to enable indexed vertices; creates a static index VBO if none provided.
Constructs a VAO (in the currently bound VAO) that matches this to GlslProg shader, overriding the mapping of a geom::Attrib to a named attribute via the 'a attributeMapping std::map.
uint32_t cinder::gl::VboMesh::getNumVertices |
( |
| ) |
const |
Returns the number of vertices in the mesh.
uint32_t cinder::gl::VboMesh::getNumIndices |
( |
| ) |
const |
Returns the number of indices for indexed geometry, otherwise 0.
GLenum cinder::gl::VboMesh::getGlPrimitive |
( |
| ) |
const |
Returns the primitive type, such as GL_TRIANGLES, GL_TRIANGLE_STRIP, etc.
GLenum cinder::gl::VboMesh::getIndexDataType |
( |
| ) |
const |
Returns the data type of the indices contained in index vbo; either GL_UNSIGNED_SHORT or GL_UNSIGNED_INT.
uint8_t cinder::gl::VboMesh::getAttribDims |
( |
geom::Attrib |
attr | ) |
const |
Returns 0 if attr is not present.
Returns AttribSet of geom::Attribs present in the VboMesh.
VboRef cinder::gl::VboMesh::getIndexVbo |
( |
| ) |
|
Returns the VBO containing the indices of the mesh, or a NULL for non-indexed geometry.
std::vector< VboRef > cinder::gl::VboMesh::getVertexArrayVbos |
( |
| ) |
|
Builds and returns a vector of VboRefs for the vertex data of the mesh.
Returns the vector of pairs of (BufferLayout,VboRef) for the vertex data of the mesh.
Returns a pair<geom::BufferLayout,VboRef>* that corresponds to attrib. Returns nullptr if not found.
void cinder::gl::VboMesh::bufferAttrib |
( |
geom::Attrib |
attrib, |
|
|
size_t |
dataSizeBytes, |
|
|
const void * |
data |
|
) |
| |
Fails with an error on ES 2 platforms which don't support buffer mapping when used with interleaved buffers. When multiple attributes are stored interleaved in a single VBO, this can be less efficient than calling mapAttrib*() or manipulating the VBO directly.
template<typename T >
void cinder::gl::VboMesh::bufferAttrib |
( |
geom::Attrib |
attrib, |
|
|
const std::vector< T > & |
data |
|
) |
| |
Fails with an error on ES 2 platforms which don't support buffer mapping when used with interleaved buffers. When multiple attributes are stored interleaved in a single VBO, this can be less efficient than calling mapAttrib*() or manipulating the VBO directly.
void cinder::gl::VboMesh::bufferIndices |
( |
size_t |
dataSizeBytes, |
|
|
const void * |
data |
|
) |
| |
Must call unmap() on the result. Throws ExcMissingAttrib if the VboMesh doesn't contain attr.
Must call unmap() on the result. Throws ExcMissingAttrib if the VboMesh doesn't contain attr.
Must call unmap() on the result. Throws ExcMissingAttrib if the VboMesh doesn't contain attr.
Must call unmap() on the result. Throws ExcMissingAttrib if the VboMesh doesn't contain attr.
void cinder::gl::VboMesh::drawImpl |
( |
GLint |
first = 0 , |
|
|
GLsizei |
count = -1 |
|
) |
| |
Issues a glDraw* call, but without binding a VAO or sending shader vars. Consider gl::draw( VboMeshRef ) instead. Knows whether to call glDrawArrays or glDrawElements.
Returns a geom::Source which references 'this'. Inefficient - primarily useful for debugging. The returned geom::SourceRef should not outlive 'this' (not a shared_ptr).
void cinder::gl::VboMesh::downloadIndices |
( |
uint32_t * |
dest | ) |
const |
Copies indices to dest. Requires dest to provide storage for getNumIndices() indices. Inefficient - primarily useful for debugging.
void cinder::gl::VboMesh::echoVertexRange |
( |
std::ostream & |
os, |
|
|
size_t |
startIndex, |
|
|
size_t |
endIndex |
|
) |
| |
Echos all vertex data in range [startIndex, endIndex) to os. Inefficient - primarily useful for debugging.
void cinder::gl::VboMesh::echoIndexRange |
( |
std::ostream & |
os, |
|
|
size_t |
startIndex, |
|
|
size_t |
endIndex |
|
) |
| |
Echos all vertex data for the indices in range [startIndex, endIndex) to os. No-op for non-indexed geometry. Inefficient - primarily useful for debugging.
void cinder::gl::VboMesh::allocateIndexVbo |
( |
| ) |
|
|
protected |
void cinder::gl::VboMesh::echoVertices |
( |
std::ostream & |
os, |
|
|
const std::vector< uint32_t > & |
indices, |
|
|
bool |
printElements |
|
) |
| |
|
protected |
void cinder::gl::VboMesh::unmapVboImpl |
( |
const VboRef & |
vbo | ) |
|
|
protected |
friend class VboMeshGeomTarget |
|
friend |
uint32_t cinder::gl::VboMesh::mNumVertices |
|
protected |
uint32_t cinder::gl::VboMesh::mNumIndices |
|
protected |
GLenum cinder::gl::VboMesh::mGlPrimitive |
|
protected |
GLenum cinder::gl::VboMesh::mIndexType |
|
protected |
VboRef cinder::gl::VboMesh::mIndices |
|
protected |
The documentation for this class was generated from the following files: