Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
VertexBuffer Class Reference

VertexBuffer is an abstraction of low level openGL Vertex Buffer Object. More...

Inherits Ref.

Public Member Functions

int getSizePerVertex () const
 Get the size in bytes of one vertex.
 
int getVertexNumber () const
 Get the number of vertices.
 
bool updateVertices (const void *verts, int count, int begin)
 Update all or part of vertices data, if the range specified exceeds the vertex buffer, it will be clipped. More...
 
local updateVertices ( local verts, local count, local begin)
 Update all or part of vertices data, if the range specified exceeds the vertex buffer, it will be clipped. More...
 
int getSize () const
 Get the size of the vertex array in bytes, equals getSizePerVertex() * getVertexNumber().
 
GLuint getVBO () const
 Get the internal openGL handle.
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local 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...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static VertexBuffercreate (int sizePerVertex, int vertexNumber, GLenum usage=GL_STATIC_DRAW)
 Create an instance of VertexBuffer. More...
 
static bool isShadowCopyEnabled ()
 Static getter for shadowCopy.
 
local isShadowCopyEnabled ()
 Static getter for shadowCopy.
 
static void enableShadowCopy (bool enabled)
 Static setter for shadowCopy.
 
local enableShadowCopy ( local enabled)
 Static setter for shadowCopy.
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

VertexBuffer is an abstraction of low level openGL Vertex Buffer Object.

It is used to save an array of vertices.

Member Function Documentation

static VertexBuffer* create ( int  sizePerVertex,
int  vertexNumber,
GLenum  usage = GL_STATIC_DRAW 
)
static

Create an instance of VertexBuffer.

Size in bytes of one vertex. The number of vertex. A hint to indicate whether the vertexBuffer are updated frequently or not to let GL optimise it.

local create ( local  sizePerVertex,
local  vertexNumber,
local  usage = GL_STATIC_DRAW 
)
static

Create an instance of VertexBuffer.

Size in bytes of one vertex. The number of vertex. A hint to indicate whether the vertexBuffer are updated frequently or not to let GL optimise it.

bool updateVertices ( const void *  verts,
int  count,
int  begin 
)

Update all or part of vertices data, if the range specified exceeds the vertex buffer, it will be clipped.

The pointer of the vertex data. The number of vertices to update. The first vertex to update.

local updateVertices ( local  verts,
local  count,
local  begin 
)

Update all or part of vertices data, if the range specified exceeds the vertex buffer, it will be clipped.

The pointer of the vertex data. The number of vertices to update. The first vertex to update.


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