|
0.45.0
|
#include <iInstancingBuffer.h>
Public Member Functions | |
| void | addInstance (uint32 size, const void *data) |
| void | getInstance (uint32 index, uint32 size, void *data) |
| uint32 | getInstanceSize () const |
| void | setSizeHint (uint32 maxInstanceSizeHint) |
| void | finalizeData () |
| void | clear () |
| void | bind () |
| uint32 | getInstanceCount () const |
| iVertexBufferPtr | getVertexBuffer () const |
Static Public Member Functions | |
| static iInstancingBufferPtr | create (const iBufferLayout &layout, uint32 maxInstanceSizeHint=8) |
Friends | |
| class | iInstancingBufferDeleter |
instancing buffer is a convenience wrapper arround a vertex buffer to help with instancing
| void igor::iInstancingBuffer::addInstance | ( | uint32 | size, |
| const void * | data | ||
| ) |
adds instance data. This can be the data of just one instance or many.
Will reallocate memory if amount of instances exceeds size hint.
| size | the size of the data in bytes. Must be multiple of the layout size (or stride) |
| data | the data to add |
| void igor::iInstancingBuffer::bind | ( | ) |
bind instacing buffer
| void igor::iInstancingBuffer::clear | ( | ) |
clear the instancing data
|
static |
| layout | the layout of data used for instancing |
| maxInstanceSizeHint | a hint for the maximum amount of instances |
Adding more instances then specified with maxInstanceSizeHint will lead to reallocating memory and doubling the buffer size.
| void igor::iInstancingBuffer::finalizeData | ( | ) |
sets data on vertex buffer
returns instance data
| index | index of first instance to return | |
| size | the size of data to returns. Must be multiple of the layout size (or stride) | |
| [out] | data | the data to return |
| uint32 igor::iInstancingBuffer::getInstanceCount | ( | ) | const |
| uint32 igor::iInstancingBuffer::getInstanceSize | ( | ) | const |
| iVertexBufferPtr igor::iInstancingBuffer::getVertexBuffer | ( | ) | const |
| void igor::iInstancingBuffer::setSizeHint | ( | uint32 | maxInstanceSizeHint | ) |
sets a new size hint.
If new size hint is smaller then the previous one nothing will change.
| maxInstanceSizeHint | a hint for the maximum amout of instances |
|
friend |