charcoal/CharcoalBuiltin/LitScene.h
elipzer 7cbe8acf30 Libraries Work!
Now the code is being compiled through .lib files!
2018-10-11 01:26:24 -04:00

57 lines
1.2 KiB
C++

#pragma once
#include <vector>
#include <charcoal/Camera.h>
#include "AutoPrerenderingScene.h"
#include "LitTypes.h"
#include "Batched.h"
#include "LitBatch.h"
#include "LitShaderProgram.h"
namespace charcoal
{
namespace builtin
{
namespace lit
{
// A scene lit by the Phong Reflection Model (See https://en.wikipedia.org/wiki/Phong_reflection_model )
class Scene : public AutoPrerenderingScene, public Batched<Renderable, Batch>
{
public:
Scene(Application& application) : AutoPrerenderingScene(application) {}
virtual ~Scene() {}
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; }
Light& add_light(
const Position& position,
const Light::Power& power,
const ColorRGB ambient,
const ColorRGB diffuse,
const ColorRGB specular,
const Light::Fade& fade
)
{
m_lights.emplace_back(position, power, ambient, diffuse, specular, fade);
return m_lights.back();
}
private:
ShaderProgram m_shader_program;
const Camera* m_p_camera = nullptr;
std::vector<Light> m_lights;
};
}
}
}