Cinder  0.9.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cinder::gl::VboMesh::Layout Class Reference

#include <VboMesh.h>

Public Member Functions

 Layout ()
 
Layoutinterleave (bool interleave=true)
 
bool getInterleave () const
 
Layoutusage (GLenum usage)
 
GLenum getUsage () const
 
Layoutattrib (geom::Attrib attrib, uint8_t dims)
 
Layoutattrib (const geom::AttribInfo &attribInfo)
 
std::vector< geom::AttribInfo > & getAttribs ()
 
const std::vector< geom::AttribInfo > & getAttribs () const
 
void clearAttribs ()
 

Protected Member Functions

void allocate (size_t numVertices, geom::BufferLayout *resultBufferLayout, gl::VboRef *resultVbo) const
 

Protected Attributes

GLenum mUsage
 
bool mInterleave
 
std::vector< geom::AttribInfomAttribInfos
 
friend VboMesh
 

Constructor & Destructor Documentation

cinder::gl::VboMesh::Layout::Layout ( )

Member Function Documentation

Layout& cinder::gl::VboMesh::Layout::interleave ( bool  interleave = true)

Specifies whether the data is stored planar or interleaved. Deafult is interleaved.

bool cinder::gl::VboMesh::Layout::getInterleave ( ) const

Returns whether the Layout stores data as interleaved (rather than planar)

Layout& cinder::gl::VboMesh::Layout::usage ( GLenum  usage)

For Desktop GL, GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, or GL_DYNAMIC_COPY. For ES 2, GL_STREAM_DRAW, GL_STATIC_DRAW, or GL_DYNAMIC_DRAW

GLenum cinder::gl::VboMesh::Layout::getUsage ( ) const

Returns the usage for the Layout. Default is GL_STATIC_DRAW.

VboMesh::Layout & cinder::gl::VboMesh::Layout::attrib ( geom::Attrib  attrib,
uint8_t  dims 
)

Appends an attribute of semantic attrib which is dims-dimensional. Replaces AttribInfo if it exists for attrib.

VboMesh::Layout & cinder::gl::VboMesh::Layout::attrib ( const geom::AttribInfo attribInfo)

Appends an attribute using a geom::AttribInfo. Replaces AttribInfo if it exists for attribInfo.getAttrib()

std::vector<geom::AttribInfo>& cinder::gl::VboMesh::Layout::getAttribs ( )
const std::vector<geom::AttribInfo>& cinder::gl::VboMesh::Layout::getAttribs ( ) const
void cinder::gl::VboMesh::Layout::clearAttribs ( )

Clears all attributes in the Layout.

void cinder::gl::VboMesh::Layout::allocate ( size_t  numVertices,
geom::BufferLayout resultBufferLayout,
gl::VboRef resultVbo 
) const
protected

If resultVbo is null then no VBO is allocated.

Member Data Documentation

GLenum cinder::gl::VboMesh::Layout::mUsage
protected
bool cinder::gl::VboMesh::Layout::mInterleave
protected
std::vector<geom::AttribInfo> cinder::gl::VboMesh::Layout::mAttribInfos
protected
friend cinder::gl::VboMesh::Layout::VboMesh
protected

The documentation for this class was generated from the following files: