Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
BufferMTL Class Reference

Used to store vertex and index data data. More...

#include <BufferMTL.h>

Inherits Buffer.

Public Member Functions

Constructor, Destructor and Initializers
 BufferMTL (id< MTLDevice > mtlDevice, std::size_t size, BufferType type, BufferUsage usage)
 BufferMTL constructor.
 
Update Buffer
virtual void updateData (const void *data, std::size_t size) override
 Update buffer data.
 
virtual void updateSubData (const void *data, std::size_t offset, std::size_t size) override
 Update buffer sub-region data.
 
virtual void usingDefaultStoredData (bool needDefaultStoredData) override
 Emply implementation.
 
- Public Member Functions inherited from Buffer
std::size_t getSize () const
 Get buffer size in bytes.
 
- Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
 
void release ()
 Releases the ownership immediately.
 
Objectautorelease ()
 Releases the ownership sometime soon automatically.
 
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
 
virtual ~Object ()
 Destructor.
 

Setters & Getters

void beginFrame ()
 a triple buffering Will switch to next buffer and use the buffer in the following render pass in current frame.
 

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 

Detailed Description

Used to store vertex and index data data.

Dynamic buffer data refers to frequently updated data stored in a buffer. To avoid creating new buffers per frame and to minimize processor idle time between frames, implement a triple buffering model to update dynamic buffer.

Constructor & Destructor Documentation

◆ BufferMTL()

BufferMTL ( id< MTLDevice > mtlDevice,
std::size_t size,
BufferType type,
BufferUsage usage )

BufferMTL constructor.

Parameters
mtlDeviceThe device for which MTLBuffer object was created.
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

◆ updateData()

virtual void updateData ( const 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.

◆ updateSubData()

virtual void updateSubData ( const 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.

◆ usingDefaultStoredData()

virtual void usingDefaultStoredData ( bool needDefaultStoredData)
inlineoverridevirtual

Emply implementation.

Mainly used in EGL context lost.

Implements Buffer.


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