2D_Game_Engine
Loading...
Searching...
No Matches
editor.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <camera.hpp>
4
5class Scene;
6class Framebuffer;
8
9extern std::string WINDOW_NAME;
10extern unsigned int WINDOW_WIDTH;
11extern unsigned int WINDOW_HEIGHT;
12extern unsigned int FULLSCREEN_WIDTH;
13extern unsigned int FULLSCREEN_HEIGHT;
14extern std::string SCENE_PATH;
15extern bool RESIZABLE;
16
17class Editor{
18public:
19 Editor(unsigned int width,unsigned int height,float fullscreen_width,float fullscreen_height,bool resizable=false);
20 ~Editor();
21
22 void Run();
23 void OnImGuiUpdate();
24 void OnImGuiRender();
25 void OnSceneRender();
26 void HighlightEntity(uint32_t uid);
27private:
28 friend class Renderer;
29
30 void EntitiesMenu(ImVec2 pos);
31 void ComponentsMenu(ImVec2 pos);
32 void DataMenu(ImVec2 pos);
33 void VariablesMenu(ImVec2 pos);
34 void FileBrowserMenu(ImVec2 pos);
35
36 void HdrWindow(bool *open);
37
38 void SerializeProject();
39 void DeserializeProject();
40
41 void HandleInputs();
42
43 Camera m_Camera;
44 Scene *m_Scene=nullptr;
45 std::vector<std::pair<std::string,uint32_t>> m_ScriptComponents;
46 Framebuffer *m_SceneFramebuffer=nullptr;
47 SceneSerializer *m_SceneSerializer;
48 std::string m_ScenePath="test.scene"; //cambialo fabio
49 std::string m_ProjectPath="test.proj"; //cambialo fabio
50 uint32_t m_SelectedEntity=std::numeric_limits<uint32_t>::max();
51
52 std::string m_CurrentPath=std::filesystem::current_path().string();
53 std::vector<std::filesystem::directory_entry> m_CurrentEntries;
54 std::string m_SelectedFileContent;
55 bool m_UpdateFiles;
56
57 bool m_HdrOpen;
58
59 Vec2 m_ScenePos;
60 Vec2 m_SceneSize;
61};
void HandleInputs()
Editor(unsigned int width, unsigned int height, float fullscreen_width, float fullscreen_height, bool resizable=false)
Definition editor.cpp:24
void OnImGuiUpdate()
Definition editor.cpp:169
void HighlightEntity(uint32_t uid)
Definition editor.cpp:120
void OnImGuiRender()
Definition editor.cpp:868
~Editor()
Definition editor.cpp:62
void Run()
Definition editor.cpp:68
void OnSceneRender()
Definition editor.cpp:116
Definition scene.hpp:6
unsigned int FULLSCREEN_WIDTH
Definition editor.cpp:19
std::string WINDOW_NAME
Definition editor.cpp:16
unsigned int WINDOW_HEIGHT
Definition editor.cpp:18
unsigned int WINDOW_WIDTH
Definition editor.cpp:17
bool RESIZABLE
Definition editor.cpp:22
std::string SCENE_PATH
Definition editor.cpp:21
unsigned int FULLSCREEN_HEIGHT
Definition editor.cpp:20