| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

BaseEditor.h
Go to the documentation of this file.
1 #pragma once
2
3 #include <imgui.h>
4 #include <entt/entity/registry.hpp>
5 #include "imgui_entt_entity_editor.hpp"
6 #include "FileBrowser.h"
7
8 namespace Fling
9 {
13 class BaseEditor
14 {
15 friend class Engine;
16
17 public:
18 BaseEditor() = default;
19 virtual ~BaseEditor() = default;
20
22 virtual void RegisterComponents(entt::registry& t_Reg);
23
27 virtual void Draw(entt::registry& t_Reg, float DeltaTime);
28
29 // #TODO: Init and shutdown functions
30
31 protected:
32
33 virtual void OnLoadLevel(std::string t_FileName);
34
35 virtual void OnSaveLevel(std::string t_FileName);
36
37 std::array<float, 400> fpsGraph {};
38 float m_FrameTimeMin = 9999.0f;
39 float m_FrameTimeMax = 0.0f;
40
41 bool m_DisplayGPUInfo = false;
42 bool m_DisplayComponentEditor = true;
43 bool m_DisplayWorldOutline = true;
44 bool m_DisplayWindowOptions = false;
45
47 entt::entity m_CompEditorEntityType = entt::null;
48 MM::ImGuiEntityEditor<entt::registry> m_ComponentEditor;
49
50 virtual void DrawFileMenu();
51
52 void DrawGpuInfo();
53
54 void DrawWorldOutline(entt::registry& t_Reg);
55
56 void DrawWindowOptions();
57
58 class World* m_OwningWorld = nullptr;
59
60 class Game* m_Game = nullptr;
61
62
63 // Draw stats graph
64 // Draw File Menu
65 // Draw Gizmos, etc
66 // Draw component editor
67 };
68 } // namespace Fling
Fling::BaseEditor
The BaseEditor of the Fling Engine.
Definition: BaseEditor.h:13
Fling::BaseEditor::m_DisplayWindowOptions
bool m_DisplayWindowOptions
Definition: BaseEditor.h:44
Fling::BaseEditor::BaseEditor
BaseEditor()=default
Fling::BaseEditor::~BaseEditor
virtual ~BaseEditor()=default
Fling::BaseEditor::DrawWindowOptions
void DrawWindowOptions()
Fling::BaseEditor::m_DisplayComponentEditor
bool m_DisplayComponentEditor
Definition: BaseEditor.h:42
Fling::BaseEditor::m_Game
class Game * m_Game
Definition: BaseEditor.h:60
Fling::Engine
Core engine class of Fling.
Definition: Engine.h:35
Fling::Game
The game class is mean to be overridden on a per-game instance.
Definition: Game.h:16
Fling::World
The world holds all active levels in the game.
Definition: World.h:21
Fling::BaseEditor::DrawGpuInfo
void DrawGpuInfo()
Fling::BaseEditor::m_ComponentEditor
MM::ImGuiEntityEditor< entt::registry > m_ComponentEditor
Definition: BaseEditor.h:48
Fling::BaseEditor::Draw
virtual void Draw(entt::registry &t_Reg, float DeltaTime)
Draws the editor via IMGUI.
Fling::BaseEditor::m_DisplayWorldOutline
bool m_DisplayWorldOutline
Definition: BaseEditor.h:43
Fling::BaseEditor::m_FrameTimeMax
float m_FrameTimeMax
Definition: BaseEditor.h:39
Fling::BaseEditor::OnLoadLevel
virtual void OnLoadLevel(std::string t_FileName)
Fling::BaseEditor::DrawWorldOutline
void DrawWorldOutline(entt::registry &t_Reg)
Fling::BaseEditor::m_OwningWorld
class World * m_OwningWorld
Definition: BaseEditor.h:58
Fling::BaseEditor::m_CompEditorEntityType
entt::entity m_CompEditorEntityType
Component editor so that we can draw our component window.
Definition: BaseEditor.h:47
Fling::BaseEditor::m_DisplayGPUInfo
bool m_DisplayGPUInfo
Definition: BaseEditor.h:41
Fling::BaseEditor::m_FrameTimeMin
float m_FrameTimeMin
Definition: BaseEditor.h:38
FileBrowser.h
Fling::BaseEditor::OnSaveLevel
virtual void OnSaveLevel(std::string t_FileName)
Fling
Definition: Engine.h:29
Fling::BaseEditor::fpsGraph
std::array< float, 400 > fpsGraph
Definition: BaseEditor.h:37
Fling::BaseEditor::RegisterComponents
virtual void RegisterComponents(entt::registry &t_Reg)
Register.
Fling::BaseEditor::DrawFileMenu
virtual void DrawFileMenu()