Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cinder::gl::VboMesh Class Reference

#include <Vbo.h>

Classes

struct  Layout
 
struct  Obj
 
class  VertexIter
 

Public Types

enum  { NONE, STATIC, DYNAMIC }
 
enum  {
  ATTR_INDICES, ATTR_POSITIONS, ATTR_NORMALS, ATTR_COLORS_RGB,
  ATTR_COLORS_RGBA, ATTR_TEXCOORDS2D_0, ATTR_TEXCOORDS2D_1, ATTR_TEXCOORDS2D_2,
  ATTR_TEXCOORDS2D_3, ATTR_TEXCOORDS3D_0, ATTR_TEXCOORDS3D_1, ATTR_TEXCOORDS3D_2,
  ATTR_TEXCOORDS3D_3, ATTR_TOTAL
}
 
enum  { ATTR_MAX_TEXTURE_UNIT = 3 }
 
enum  { INDEX_BUFFER = 0, STATIC_BUFFER, DYNAMIC_BUFFER, TOTAL_BUFFERS }
 

Public Member Functions

 VboMesh ()
 
 VboMesh (const TriMesh &triMesh, Layout layout=Layout())
 
 VboMesh (const TriMesh2d &triMesh, Layout layout=Layout())
 
 VboMesh (size_t numVertices, size_t numIndices, Layout layout, GLenum primitiveType)
 
 VboMesh (size_t numVertices, size_t numIndices, Layout layout, GLenum primitiveType, Vbo *indexBuffer, Vbo *staticBuffer, Vbo *dynamicBuffer)
 
size_t getNumIndices () const
 
size_t getNumVertices () const
 
GLenum getPrimitiveType () const
 
const LayoutgetLayout () const
 
void bindIndexBuffer () const
 
void enableClientStates () const
 
void disableClientStates () const
 
void bindAllData () const
 
void bufferIndices (const std::vector< uint32_t > &indices)
 
void bufferPositions (const std::vector< Vec3f > &positions)
 
void bufferPositions (const Vec3f *positions, size_t count)
 
void bufferNormals (const std::vector< Vec3f > &normals)
 
void bufferTexCoords2d (size_t unit, const std::vector< Vec2f > &texCoords)
 
void bufferTexCoords3d (size_t unit, const std::vector< Vec3f > &texCoords)
 
void bufferColorsRGB (const std::vector< Color > &colors)
 
void bufferColorsRGBA (const std::vector< ColorA > &colors)
 
class VertexIter mapVertexBuffer ()
 
VbogetIndexVbo () const
 
VbogetStaticVbo () const
 
VbogetDynamicVbo () const
 
void setCustomStaticLocation (size_t internalIndex, GLuint location)
 
void setCustomDynamicLocation (size_t internalIndex, GLuint location)
 
size_t getTexCoordOffset (size_t unit) const
 
void setTexCoordOffset (size_t unit, size_t aTexCoordOffset)
 

Static Public Member Functions

static VboMeshRef create (const TriMesh &triMesh, Layout layout=Layout())
 
static VboMeshRef create (const TriMesh2d &triMesh, Layout layout=Layout())
 
static VboMeshRef create (size_t numVertices, size_t numIndices, Layout layout, GLenum primitiveType)
 
static VboMeshRef create (size_t numVertices, size_t numIndices, Layout layout, GLenum primitiveType, Vbo *indexBuffer, Vbo *staticBuffer, Vbo *dynamicBuffer)
 
static void unbindBuffers ()
 

Protected Member Functions

void initializeBuffers (bool staticDataPlanar)
 

Protected Attributes

std::shared_ptr< ObjmObj
 
typedef std::shared_ptr< Obj >
VboMesh::* 
unspecified_bool_type
 Emulates shared_ptr-like behavior. More...
 
 operator unspecified_bool_type () const
 Emulates shared_ptr-like behavior. More...
 
void reset ()
 Emulates shared_ptr-like behavior. More...
 

Member Typedef Documentation

typedef std::shared_ptr<Obj> VboMesh::* cinder::gl::VboMesh::unspecified_bool_type

Emulates shared_ptr-like behavior.

Member Enumeration Documentation

anonymous enum
Enumerator
NONE 
STATIC 
DYNAMIC 
anonymous enum
Enumerator
ATTR_INDICES 
ATTR_POSITIONS 
ATTR_NORMALS 
ATTR_COLORS_RGB 
ATTR_COLORS_RGBA 
ATTR_TEXCOORDS2D_0 
ATTR_TEXCOORDS2D_1 
ATTR_TEXCOORDS2D_2 
ATTR_TEXCOORDS2D_3 
ATTR_TEXCOORDS3D_0 
ATTR_TEXCOORDS3D_1 
ATTR_TEXCOORDS3D_2 
ATTR_TEXCOORDS3D_3 
ATTR_TOTAL 
anonymous enum
Enumerator
ATTR_MAX_TEXTURE_UNIT 
anonymous enum
Enumerator
INDEX_BUFFER 
STATIC_BUFFER 
DYNAMIC_BUFFER 
TOTAL_BUFFERS 

Constructor & Destructor Documentation

cinder::gl::VboMesh::VboMesh ( )
cinder::gl::VboMesh::VboMesh ( const TriMesh triMesh,
Layout  layout = Layout() 
)
explicit
cinder::gl::VboMesh::VboMesh ( const TriMesh2d triMesh,
Layout  layout = Layout() 
)
explicit
cinder::gl::VboMesh::VboMesh ( size_t  numVertices,
size_t  numIndices,
Layout  layout,
GLenum  primitiveType 
)
cinder::gl::VboMesh::VboMesh ( size_t  numVertices,
size_t  numIndices,
Layout  layout,
GLenum  primitiveType,
Vbo indexBuffer,
Vbo staticBuffer,
Vbo dynamicBuffer 
)

Member Function Documentation

static VboMeshRef cinder::gl::VboMesh::create ( const TriMesh triMesh,
Layout  layout = Layout() 
)
static
static VboMeshRef cinder::gl::VboMesh::create ( const TriMesh2d triMesh,
Layout  layout = Layout() 
)
static
static VboMeshRef cinder::gl::VboMesh::create ( size_t  numVertices,
size_t  numIndices,
Layout  layout,
GLenum  primitiveType 
)
static
static VboMeshRef cinder::gl::VboMesh::create ( size_t  numVertices,
size_t  numIndices,
Layout  layout,
GLenum  primitiveType,
Vbo indexBuffer,
Vbo staticBuffer,
Vbo dynamicBuffer 
)
static
size_t cinder::gl::VboMesh::getNumIndices ( ) const
size_t cinder::gl::VboMesh::getNumVertices ( ) const
GLenum cinder::gl::VboMesh::getPrimitiveType ( ) const
const Layout& cinder::gl::VboMesh::getLayout ( ) const
void cinder::gl::VboMesh::bindIndexBuffer ( ) const
void cinder::gl::VboMesh::enableClientStates ( ) const
void cinder::gl::VboMesh::disableClientStates ( ) const
void cinder::gl::VboMesh::bindAllData ( ) const
void cinder::gl::VboMesh::unbindBuffers ( )
static
void cinder::gl::VboMesh::bufferIndices ( const std::vector< uint32_t > &  indices)
void cinder::gl::VboMesh::bufferPositions ( const std::vector< Vec3f > &  positions)
void cinder::gl::VboMesh::bufferPositions ( const Vec3f positions,
size_t  count 
)
void cinder::gl::VboMesh::bufferNormals ( const std::vector< Vec3f > &  normals)
void cinder::gl::VboMesh::bufferTexCoords2d ( size_t  unit,
const std::vector< Vec2f > &  texCoords 
)
void cinder::gl::VboMesh::bufferTexCoords3d ( size_t  unit,
const std::vector< Vec3f > &  texCoords 
)
void cinder::gl::VboMesh::bufferColorsRGB ( const std::vector< Color > &  colors)
void cinder::gl::VboMesh::bufferColorsRGBA ( const std::vector< ColorA > &  colors)
VboMesh::VertexIter cinder::gl::VboMesh::mapVertexBuffer ( )
Vbo& cinder::gl::VboMesh::getIndexVbo ( ) const
Vbo& cinder::gl::VboMesh::getStaticVbo ( ) const
Vbo& cinder::gl::VboMesh::getDynamicVbo ( ) const
void cinder::gl::VboMesh::setCustomStaticLocation ( size_t  internalIndex,
GLuint  location 
)
void cinder::gl::VboMesh::setCustomDynamicLocation ( size_t  internalIndex,
GLuint  location 
)
size_t cinder::gl::VboMesh::getTexCoordOffset ( size_t  unit) const
void cinder::gl::VboMesh::setTexCoordOffset ( size_t  unit,
size_t  aTexCoordOffset 
)
cinder::gl::VboMesh::operator unspecified_bool_type ( ) const

Emulates shared_ptr-like behavior.

void cinder::gl::VboMesh::reset ( )

Emulates shared_ptr-like behavior.

void cinder::gl::VboMesh::initializeBuffers ( bool  staticDataPlanar)
protected

Member Data Documentation

std::shared_ptr<Obj> cinder::gl::VboMesh::mObj
protected

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