|
Axmol 3.0.0-89d6d9a
|
Used to store vertex and index data data. More...
#include <BufferMTL.h>
Inherits Buffer.
Public Member Functions | |
Constructor, Destructor and Initializers | |
| BufferImpl (id< MTLDevice > mtlDevice, size_t size, BufferType type, BufferUsage usage, const void *inital, uint32_t stride=0) | |
| BufferImpl constructor. | |
Update Buffer | |
| void | updateData (const void *data, size_t size) override |
| Update buffer data. | |
| void | updateSubData (const void *data, size_t offset, size_t size) override |
| Update buffer sub-region data. | |
| void | usingDefaultStoredData (bool needDefaultStoredData) override |
| Emply implementation. | |
| Public Member Functions inherited from Buffer | |
| size_t | getSize () const |
| Get buffer size in bytes. | |
| uint32_t | getStride () const |
| Get the logical storage element stride in bytes. | |
| Public Member Functions inherited from Object | |
| void | retain () |
| Retains the ownership. | |
| void | release () |
| Releases the ownership immediately. | |
| Object * | autorelease () |
| Releases the ownership sometime soon automatically. | |
| unsigned int | getReferenceCount () const |
| Returns the Object's current reference count. | |
| uint64_t | getObjectID () const noexcept |
| Returns the process-local diagnostic identifier assigned at construction. | |
| 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. | |
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.
| BufferImpl | ( | id< MTLDevice > | mtlDevice, |
| size_t | size, | ||
| BufferType | type, | ||
| BufferUsage | usage, | ||
| const void * | inital, | ||
| uint32_t | stride = 0 ) |
BufferImpl constructor.
| mtlDevice | The device for which MTLBuffer object was created. |
| size | Specifies the size in bytes of the buffer object's new data store. |
| type | Specifies the target buffer object. The symbolic constant must be BufferType::VERTEX or BufferType::INDEX. |
| usage | Specifies the expected usage pattern of the data store. The symbolic constant must be BufferUsage::STATIC, BufferUsage::DYNAMIC. |
|
overridevirtual |
Update buffer data.
| data | Specifies a pointer to data that will be copied into the data store for initialization. |
| size | Specifies the size in bytes of the data store region being replaced. |
Implements Buffer.
|
overridevirtual |
Update buffer sub-region data.
| data | Specifies a pointer to the new data that will be copied into the data store. |
| offset | Specifies the offset into the buffer object's data store where data replacement will begin, measured in bytes. |
| size | Specifies the size in bytes of the data store region being replaced. |
Implements Buffer.
|
inlineoverridevirtual |