25 lines
553 B
C
25 lines
553 B
C
|
#pragma once
|
||
|
|
||
|
namespace charcoal
|
||
|
{
|
||
|
namespace builtin
|
||
|
{
|
||
|
template <typename RenderableType, typename BatchType>
|
||
|
class Batched
|
||
|
{
|
||
|
protected:
|
||
|
BatchType& add_batch(RenderableType* renderable, int element_count)
|
||
|
{
|
||
|
return add_batch(renderable, element_count, element_count);
|
||
|
}
|
||
|
|
||
|
BatchType& add_batch(RenderableType* renderable, int element_count, int element_render_count)
|
||
|
{
|
||
|
m_batches.emplace_back(renderable, element_count, element_render_count);
|
||
|
return m_batches.back();
|
||
|
}
|
||
|
|
||
|
std::vector<BatchType> m_batches;
|
||
|
};
|
||
|
}
|
||
|
}
|