#pragma once #include #include "AutoPrerenderingScene.h" #include "LitTypes.h" #include "Camera.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 { 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 m_lights; }; } } }