Cocos2d-x  4.0.0
Public Member Functions | List of all members
BufferGL Class Reference

Store vertex and index data. More...

Inherits Buffer.

Public Member Functions

 BufferGL (std::size_t size, BufferType type, BufferUsage usage)
 
virtual void updateData (void *data, std::size_t size) override
 Update buffer data.
 
virtual void updateSubData (void *data, std::size_t offset, std::size_t size) override
 Update buffer sub-region data.
 
virtual void usingDefaultStoredData (bool needDefaultStoredData) override
 Static buffer data will automatically stored when it comes to foreground.
 
GLuint getHandler () const
 Get buffer object.
 
- Public Member Functions inherited from Buffer
std::size_t getSize () const
 Get buffer size in bytes.
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership.
 
void release ()
 Releases the ownership immediately.
 
Refautorelease ()
 Releases the ownership sometime soon automatically.
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count.
 
virtual ~Ref ()
 Destructor.
 

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

Store vertex and index data.

Constructor & Destructor Documentation

BufferGL ( std::size_t  size,
BufferType  type,
BufferUsage  usage 
)
Parameters
sizeSpecifies the size in bytes of the buffer object's new data store.
typeSpecifies the target buffer object. The symbolic constant must be BufferType::VERTEX or BufferType::INDEX.
usageSpecifies the expected usage pattern of the data store. The symbolic constant must be BufferUsage::STATIC, BufferUsage::DYNAMIC.

Member Function Documentation

virtual void updateData ( void *  data,
std::size_t  size 
)
overridevirtual

Update buffer data.

Parameters
dataSpecifies a pointer to data that will be copied into the data store for initialization.
sizeSpecifies the size in bytes of the data store region being replaced.
See Also
updateSubData(void* data, unsigned int offset, unsigned int size)

Implements Buffer.

virtual void updateSubData ( void *  data,
std::size_t  offset,
std::size_t  size 
)
overridevirtual

Update buffer sub-region data.

Parameters
dataSpecifies a pointer to the new data that will be copied into the data store.
offsetSpecifies the offset into the buffer object's data store where data replacement will begin, measured in bytes.
sizeSpecifies the size in bytes of the data store region being replaced.
See Also
updateData(void* data, unsigned int size)

Implements Buffer.

virtual void usingDefaultStoredData ( bool  needDefaultStoredData)
overridevirtual

Static buffer data will automatically stored when it comes to foreground.

This interface is used to indicate whether external data needs to be used to update the buffer(false) instead of using the default stored data(true).

Parameters
needDefaultStoredDataSpecifies whether to use the default stored data.

Implements Buffer.

GLuint getHandler ( ) const
inline

Get buffer object.

Returns
Buffer object.

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