charcoal/CharcoalBuiltin/BuiltinPipeline.h
elipzer 8ee0ab2edb Lighting works... Just not properly
Commiting now so that there is something displaying for the lit
scene.
2018-10-15 22:38:59 -04:00

31 lines
736 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();
}
}
protected:
virtual void prepare_opengl() {};
virtual void prepare_uniforms() {};
};
}
}