2018-09-13 04:51:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-09-13 23:21:34 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "AutoPrerenderingScene.h"
|
2018-09-13 04:51:47 +00:00
|
|
|
|
|
|
|
#include "BasicShaderProgram.h"
|
|
|
|
#include "BasicBatch.h"
|
2018-09-13 17:35:30 +00:00
|
|
|
#include "Camera2D.h"
|
2018-09-13 04:51:47 +00:00
|
|
|
|
|
|
|
#include "constants.h"
|
|
|
|
|
|
|
|
namespace charcoal
|
|
|
|
{
|
|
|
|
namespace builtin
|
|
|
|
{
|
2018-09-13 23:21:34 +00:00
|
|
|
class BasicScene : public AutoPrerenderingScene
|
2018-09-13 04:51:47 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-09-13 23:21:34 +00:00
|
|
|
BasicScene(Application& application) : AutoPrerenderingScene(application) {}
|
|
|
|
virtual ~BasicScene() {}
|
2018-09-13 04:51:47 +00:00
|
|
|
|
|
|
|
void init() override;
|
|
|
|
|
|
|
|
void use() override;
|
|
|
|
|
|
|
|
void unuse() override;
|
|
|
|
|
2018-09-13 23:21:34 +00:00
|
|
|
void render() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void set_camera(const Camera* p_camera) { m_p_camera = p_camera; }
|
2018-09-13 17:35:30 +00:00
|
|
|
|
2018-09-13 23:21:34 +00:00
|
|
|
BasicBatch& add_batch(BasicRenderable* renderable, int element_count);
|
2018-09-13 04:51:47 +00:00
|
|
|
|
2018-09-13 23:21:34 +00:00
|
|
|
BasicBatch& add_batch(BasicRenderable* renderable, int element_count, int element_render_count);
|
2018-09-13 04:51:47 +00:00
|
|
|
|
2018-09-13 17:35:30 +00:00
|
|
|
private:
|
2018-09-13 04:51:47 +00:00
|
|
|
BasicShaderProgram m_shader_program;
|
2018-09-13 23:21:34 +00:00
|
|
|
std::vector<BasicBatch> m_batches;
|
|
|
|
const Camera* m_p_camera = nullptr;
|
2018-09-13 04:51:47 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|