cocos2d-x  3.2alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Mesh Class Reference

Mesh: TODO, add description of Mesh. More...

#include <CCMesh.h>

Inheritance diagram for Mesh:
Ref

Public Types

enum  IndexFormat { INDEX8 = GL_UNSIGNED_BYTE, INDEX16 = GL_UNSIGNED_SHORT }
 Defines supported index formats. More...
 
enum  PrimitiveType {
  TRIANGLES = GL_TRIANGLES, TRIANGLE_STRIP = GL_TRIANGLE_STRIP, LINES = GL_LINES, LINE_STRIP = GL_LINE_STRIP,
  POINTS = GL_POINTS
}
 Defines supported primitive types. More...
 

Public Member Functions

GLuint getVertexBuffer () const
ssize_t getMeshVertexAttribCount () const
const MeshVertexAttrib & getMeshVertexAttribute (int idx) const
bool hasVertexAttrib (int attrib)
int getVertexSizeInBytes () const
PrimitiveType getPrimitiveType () const
ssize_t getIndexCount () const
IndexFormat getIndexFormat () const
GLuint getIndexBuffer () const
void restore ()
virtual ~Mesh ()
bool init (const std::vector< float > &positions, const std::vector< float > &normals, const std::vector< float > &texs, const std::vector< unsigned short > &indices)
bool init (const std::vector< float > &vertices, int vertexSizeInFloat, const std::vector< unsigned short > &indices, int numIndex, const std::vector< MeshVertexAttrib > &attribs, int attribCount)
void buildBuffer ()
void cleanAndFreeBuffers ()
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Ref * autorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()

Static Public Member Functions

static Mesh * create (const std::vector< float > &positions, const std::vector< float > &normals, const std::vector< float > &texs, const std::vector< unsigned short > &indices)
static Mesh * create (const std::vector< float > &vertices, int vertexSizeInFloat, const std::vector< unsigned short > &indices, int numIndex, const std::vector< MeshVertexAttrib > &attribs, int attribCount)

Public Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: Mesh()

Protected Attributes

PrimitiveType _primitiveType
IndexFormat _indexFormat
GLuint _vertexBuffer
GLuint _indexBuffer
ssize_t _indexCount
RenderMeshData _renderdata
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Detailed Description

Mesh: TODO, add description of Mesh.

Member Enumeration Documentation

enum IndexFormat
strong

Defines supported index formats.

Enumerator
INDEX8 
INDEX16 
enum PrimitiveType
strong

Defines supported primitive types.

Enumerator
TRIANGLES 
TRIANGLE_STRIP 
LINES 
LINE_STRIP 
POINTS 

Constructor & Destructor Documentation

virtual ~Mesh ( )
virtual

Member Function Documentation

void buildBuffer ( )
void cleanAndFreeBuffers ( )
static Mesh* create ( const std::vector< float > &  positions,
const std::vector< float > &  normals,
const std::vector< float > &  texs,
const std::vector< unsigned short > &  indices 
)
static
static Mesh* create ( const std::vector< float > &  vertices,
int  vertexSizeInFloat,
const std::vector< unsigned short > &  indices,
int  numIndex,
const std::vector< MeshVertexAttrib > &  attribs,
int  attribCount 
)
static
GLuint getIndexBuffer ( ) const
inline
ssize_t getIndexCount ( ) const
inline
IndexFormat getIndexFormat ( ) const
inline
ssize_t getMeshVertexAttribCount ( ) const
inline
const MeshVertexAttrib&
getMeshVertexAttribute
( int  idx) const
inline
PrimitiveType getPrimitiveType ( ) const
inline
GLuint getVertexBuffer ( ) const
inline
int getVertexSizeInBytes ( ) const
inline
bool hasVertexAttrib ( int  attrib)
inline
bool init ( const std::vector< float > &  positions,
const std::vector< float > &  normals,
const std::vector< float > &  texs,
const std::vector< unsigned short > &  indices 
)
bool init ( const std::vector< float > &  vertices,
int  vertexSizeInFloat,
const std::vector< unsigned short > &  indices,
int  numIndex,
const std::vector< MeshVertexAttrib > &  attribs,
int  attribCount 
)
void restore ( )

Member Data Documentation

GLuint _indexBuffer
protected
ssize_t _indexCount
protected
IndexFormat _indexFormat
protected
PrimitiveType _primitiveType
protected
RenderMeshData _renderdata
protected
GLuint _vertexBuffer
protected

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