0.44.0
|
#include <iInstancingBuffer.h>
Public Member Functions | |
void | addInstance (uint32 size, const void *data) |
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=100) |
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 amout 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
uint32 igor::iInstancingBuffer::getInstanceCount | ( | ) | 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 |