2D_Game_Engine
Loading...
Searching...
No Matches
application_template.cpp
Go to the documentation of this file.
1#include <pch.hpp>
2#include <sceneserializer.hpp>
3#include <application.hpp>
4
5extern const char *WINDOW_NAME;
6extern unsigned int WINDOW_WIDTH;
7extern unsigned int WINDOW_HEIGHT;
8extern unsigned int FULLSCREEN_WIDTH;
9extern unsigned int FULLSCREEN_HEIGHT;
10extern std::string SCENE_PATH;
11extern bool RESIZABLE;
13extern float GAMMA;
14extern float EXPOSURE;
15
16extern void LoadScripts(Scene *scene);
17
18static SceneSerializer sceneserializer;
19
21public:
22 ApplicationTemplate(const char *window_name,unsigned int width,unsigned int height,unsigned int fullscreen_width,unsigned int fullscreen_height,std::string &scene_path,bool resizable=false,bool imgui=false): Application(window_name,width,height,fullscreen_width,fullscreen_height,resizable,imgui){
23 sceneserializer.SetScene(m_Scene);
24 sceneserializer.Deserialize(scene_path);
25
27
31
33 }
34
35 void OnUpdate(double frame_time) override{
36 m_Scene->Update(frame_time);
37 }
38
39 void OnRender() override{
41 m_Scene->Render();
44 #ifdef DEBUG
46 #endif
50 }
51};
52
float EXPOSURE
Definition data.cpp:13
unsigned int FULLSCREEN_WIDTH
Definition editor.cpp:19
void LoadScripts(Scene *scene)
Definition data.cpp:16
const char * WINDOW_NAME
Definition editor.cpp:16
unsigned int WINDOW_HEIGHT
Definition editor.cpp:18
float GAMMA
Definition data.cpp:12
unsigned int WINDOW_WIDTH
Definition editor.cpp:17
bool RESIZABLE
Definition editor.cpp:22
std::string SCENE_PATH
Definition editor.cpp:21
TonemapType TONE_MAP_TYPE
Definition data.cpp:11
unsigned int FULLSCREEN_HEIGHT
Definition editor.cpp:20
void OnUpdate(double frame_time) override
ApplicationTemplate(const char *window_name, unsigned int width, unsigned int height, unsigned int fullscreen_width, unsigned int fullscreen_height, std::string &scene_path, bool resizable=false, bool imgui=false)
Scene * m_Scene
void DrawSceneProj()
Definition camera.cpp:68
void ResetSceneProj()
Definition camera.cpp:75
void SetGamma(float gamma)
Definition renderer.cpp:238
void SetExposure(float exposure)
Definition renderer.cpp:246
void StartScene()
Definition renderer.cpp:446
void SetTonemapType(TonemapType type)
Definition renderer.cpp:230
void ReloadShaders()
Definition renderer.cpp:947
void DrawScene()
Definition renderer.cpp:481
void ApplyLight()
Definition renderer.cpp:916
void Render(bool post_processing=false)
Definition renderer.cpp:565
void SetScene(Scene *scene)
Definition scene.hpp:6
void DebugDraw()
Definition scene.cpp:381
void Render()
Definition scene.cpp:282
Camera & GetCamera()
Definition scene.hpp:190
void Update(double frame_time)
Definition scene.cpp:275
Application * CreateApplication()
TonemapType
Definition renderer.hpp:26
Renderer * RENDERER
The main renderer.
Definition window.cpp:12