cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Primitive Class Reference

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

#include <CCPrimitive.h>

Inheritance diagram for Primitive:
Ref

Public Member Functions

const VertexDatagetVertexData () const
 Get the vertexData. More...
 
local getVertexData ()
 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 primtive. More...
 
int getCount () const
 Get the number of vertices or indices used for drawing. More...
 
var getCount ()
 Get the number of vertices or indices used for drawing. More...
 
local getCount ()
 Get the number of vertices or indices used for drawing. More...
 
void setStart (int start)
 Setter for the start index. More...
 
var setStart ( var start)
 Setter for the start index. More...
 
local setStart ( local start)
 Setter for the start index. More...
 
void setCount (int count)
 Setter for the count. More...
 
var setCount ( var count)
 Setter for the count. More...
 
local setCount ( local 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...
 
local create ( local verts, local indices, local type)
 Create an instance of primitive. More...
 

Protected Member Functions

 Primitive ()
 Primitive ()
 Primitive ()
virtual ~Primitive ()
var ~Primitive ()
local ~Primitive ()
bool init (VertexData *verts, IndexBuffer *indices, int type)
var init ( var verts, var indices, var type)
local init ( local verts, local indices, local type)
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Protected Attributes

VertexData_verts
IndexBuffer_indices
var _indices
local _indices
int _start
var _start
local _start
int _count
var _count
local _count
int _type
var _type
local _type
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Detailed Description

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

Constructor & Destructor Documentation

Primitive ( )
protected
var Primitive ( )
protected
local Primitive ( )
protected
virtual ~Primitive ( )
protectedvirtual
var ~Primitive ( )
protectedvirtual
local ~Primitive ( )
protectedvirtual

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.
var create ( var  verts,
var  indices,
var  type 
)
static

Create an instance of primitive.

Parameters
vertsVertexData used in the primitive.
indicesOptional index data.
typeThe type (Points, Lines, Triangles) used.
local create ( local  verts,
local  indices,
local  type 
)
static

Create an instance of primitive.

Parameters
vertsVertexData used in the primitive.
indicesOptional index data.
typeThe type (Points, Lines, Triangles) used.
void draw ( )

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

var draw ( )

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

local draw ( )

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

int getCount ( ) const
inline

Get the number of vertices or indices used for drawing.

var getCount ( )
inline

Get the number of vertices or indices used for drawing.

local getCount ( )
inline

Get the number of vertices or indices used for drawing.

const IndexBuffer* getIndexData ( ) const

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

var getIndexData ( )

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

local getIndexData ( )

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

int getStart ( ) const
inline

Get the start index of primtive.

var getStart ( )
inline

Get the start index of primtive.

local getStart ( )
inline

Get the start index of primtive.

int getType ( ) const
inline

Get the primitive type.

var getType ( )
inline

Get the primitive type.

local getType ( )
inline

Get the primitive type.

const VertexData* getVertexData ( ) const

Get the vertexData.

var getVertexData ( )

Get the vertexData.

local getVertexData ( )

Get the vertexData.

bool init ( VertexData verts,
IndexBuffer indices,
int  type 
)
protected
var init ( var  verts,
var  indices,
var  type 
)
protected
local init ( local  verts,
local  indices,
local  type 
)
protected
void setCount ( int  count)
inline

Setter for the count.

var setCount ( var  count)
inline

Setter for the count.

local setCount ( local  count)
inline

Setter for the count.

void setStart ( int  start)
inline

Setter for the start index.

var setStart ( var  start)
inline

Setter for the start index.

local setStart ( local  start)
inline

Setter for the start index.

Member Data Documentation

int _count
protected
var _count
protected
local _count
protected
IndexBuffer* _indices
protected
var _indices
protected
local _indices
protected
int _start
protected
var _start
protected
local _start
protected
int _type
protected
var _type
protected
local _type
protected
VertexData* _verts
protected
var _verts
protected
local _verts
protected

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