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;
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
The BaseEditor of the Fling Engine.
Definition: BaseEditor.h:13
bool m_DisplayWindowOptions
Definition: BaseEditor.h:44
BaseEditor()=default
virtual ~BaseEditor()=default
void DrawWindowOptions()
bool m_DisplayComponentEditor
Definition: BaseEditor.h:42
class Game * m_Game
Definition: BaseEditor.h:60
Core engine class of Fling.
Definition: Engine.h:35
The game class is mean to be overridden on a per-game instance.
Definition: Game.h:16
The world holds all active levels in the game.
Definition: World.h:21
MM::ImGuiEntityEditor< entt::registry > m_ComponentEditor
Definition: BaseEditor.h:48
virtual void Draw(entt::registry &t_Reg, float DeltaTime)
Draws the editor via IMGUI.
bool m_DisplayWorldOutline
Definition: BaseEditor.h:43
float m_FrameTimeMax
Definition: BaseEditor.h:39
virtual void OnLoadLevel(std::string t_FileName)
void DrawWorldOutline(entt::registry &t_Reg)
class World * m_OwningWorld
Definition: BaseEditor.h:58
entt::entity m_CompEditorEntityType
Component editor so that we can draw our component window.
Definition: BaseEditor.h:47
bool m_DisplayGPUInfo
Definition: BaseEditor.h:41
float m_FrameTimeMin
Definition: BaseEditor.h:38
virtual void OnSaveLevel(std::string t_FileName)
Definition: Engine.h:29
std::array< float, 400 > fpsGraph
Definition: BaseEditor.h:37
virtual void RegisterComponents(entt::registry &t_Reg)
Register.
virtual void DrawFileMenu()