30 lines
723 B
C
30 lines
723 B
C
|
#pragma once
|
||
|
|
||
|
#include <charcoal/Pipeline.h>
|
||
|
|
||
|
namespace charcoal
|
||
|
{
|
||
|
namespace builtin
|
||
|
{
|
||
|
template <typename ShaderProgramType, typename BatchType>
|
||
|
class Pipeline : public charcoal::Pipeline<ShaderProgramType, BatchType>
|
||
|
{
|
||
|
public:
|
||
|
void render() override
|
||
|
{
|
||
|
prepare_opengl();
|
||
|
charcoal::Pipeline<ShaderProgramType, BatchType>::m_shader_program.use();
|
||
|
prepare_uniforms();
|
||
|
for (auto iter = charcoal::Pipeline<ShaderProgramType, BatchType>::m_batches.begin(); iter != charcoal::Pipeline<ShaderProgramType, BatchType>::m_batches.end(); ++iter)
|
||
|
{
|
||
|
BatchType* batch = *iter;
|
||
|
batch->render();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
virtual void prepare_opengl() {};
|
||
|
|
||
|
virtual void prepare_uniforms() {};
|
||
|
};
|
||
|
}
|
||
|
}
|