charcoal/OpenGLEngine/LitScene.h

44 lines
918 B
C
Raw Normal View History

2018-09-14 22:09:43 +00:00
#pragma once
#include <vector>
#include "AutoPrerenderingScene.h"
#include "BuiltinTypes.h"
#include "Camera.h"
#include "Batched.h"
#include "LitBatch.h"
2018-09-14 22:09:43 +00:00
#include "LitShaderProgram.h"
namespace charcoal
{
namespace builtin
{
class LitScene : public AutoPrerenderingScene, public Batched<LitRenderable, LitBatch>
{
public:
LitScene(Application& application) : AutoPrerenderingScene(application) {}
virtual ~LitScene() {}
void init() override;
void use() override;
void unuse() override;
void render() override;
protected:
void set_camera(const Camera* p_camera) { m_p_camera = p_camera; }
void add_light(const Position& position, const ColorRGB& ambient, const ColorRGB& diffuse)
{
m_lights.emplace_back(position, ambient, diffuse);
}
2018-09-14 22:09:43 +00:00
private:
LitShaderProgram m_shader_program;
const Camera* m_p_camera = nullptr;
std::vector<Light> m_lights;
};
}
}