Cocos2d-x  v3.17
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Primitive Class Reference

Primitive can support sending points, lines and triangles to glpipeline, which is an abstraction of primitive data. More...

Inherits Ref.

Public Member Functions

const VertexDatagetVertexData () const
 Get the vertexData. More...
 
const IndexBuffergetIndexData () const
 Get the optional index data, will return null if index data is not used. More...
 
int getType () const
 Get the primitive type. More...
 
void draw ()
 called by rendering framework, will send the data to GLPipeline. More...
 
int getStart () const
 Get the start index of primitive. More...
 
int getCount () const
 Get the number of vertices or indices used for drawing. More...
 
void setStart (int start)
 Setter for the start index. More...
 
void setCount (int count)
 Setter for the count. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static Primitivecreate (VertexData *verts, IndexBuffer *indices, int type)
 Create an instance of primitive. More...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

Primitive can support sending points, lines and triangles to glpipeline, which is an abstraction of primitive data.

Member Function Documentation

static Primitive* create ( VertexData verts,
IndexBuffer indices,
int  type 
)
static

Create an instance of primitive.

Parameters
vertsVertexData used in the primitive.
indicesOptional index data.
typeThe type (Points, Lines, Triangles) used.
const VertexData* getVertexData ( ) const

Get the vertexData.

const IndexBuffer* getIndexData ( ) const

Get the optional index data, will return null if index data is not used.

int getType ( ) const
inline

Get the primitive type.

void draw ( )

called by rendering framework, will send the data to GLPipeline.

int getStart ( ) const
inline

Get the start index of primitive.

int getCount ( ) const
inline

Get the number of vertices or indices used for drawing.

void setStart ( int  start)

Setter for the start index.

void setCount ( int  count)

Setter for the count.


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