vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
Gui.hpp
Go to the documentation of this file.
1///
2/// @file Gui.hpp
3/// @brief This file contains the ImGuiWindowManager class
4/// @namespace ven
5///
6
7#pragma once
8
9#include <imgui.h>
10
14
15namespace ven {
16
17 static constexpr uint16_t DESCRIPTOR_COUNT = 1000;
18
19 enum GUI_STATE : uint8_t {
22 HIDDEN = 2
23 };
24
25 ///
26 /// @class Gui
27 /// @brief Class for Gui
28 /// @namespace ven
29 ///
30 class Gui {
31
32 struct ClockData {
33 float deltaTimeMS{0.0F};
34 float fps{0.0F};
35 };
36
37 public:
38
39 Gui() = default;
40 ~Gui() = default;
41
42 Gui(const Gui&) = delete;
43 Gui& operator=(const Gui&) = delete;
44 Gui(Gui&&) = delete;
45 Gui& operator=(Gui&&) = delete;
46
47 void init(GLFWwindow* window, VkInstance instance, const Device* device, VkRenderPass renderPass);
48
49 void render(Renderer *renderer, SceneManager& sceneManager, Camera& camera, VkPhysicalDevice physicalDevice, GlobalUbo& ubo, const ClockData& clockData);
50 static void cleanup();
51
52 void setState(const GUI_STATE state) { m_state = state; }
53 [[nodiscard]] GUI_STATE getState() const { return m_state; }
54 [[nodiscard]] std::vector<unsigned int> *getObjectsToRemove() { return &m_objectsToRemove; }
55 [[nodiscard]] std::vector<unsigned int> *getLightsToRemove() { return &m_lightsToRemove; }
56
57 private:
58
59 static void initStyle();
60 static void renderFrameWindow(const ClockData& clockData);
61 static void cameraSection(Camera& camera);
62 static void inputsSection(const ImGuiIO& io);
63 static void rendererSection(Renderer *renderer, GlobalUbo& ubo);
64 static void devicePropertiesSection(VkPhysicalDeviceProperties deviceProperties);
65 void objectsSection(SceneManager& sceneManager);
66 void lightsSection(SceneManager& sceneManager);
67
68 struct funcs { static bool IsLegacyNativeDupe(const ImGuiKey key) { return key >= 0 && key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exist
69
70 ImGuiIO* m_io{nullptr};
72 float m_intensity{1.0F};
74
75 std::vector<unsigned int> m_objectsToRemove;
76 std::vector<unsigned int> m_lightsToRemove;
77
78 }; // class Gui
79
80} // namespace ven
This file contains the FrameInfo class.
This file contains the SceneManager class.
This file contains the Renderer class.
Class for camera.
Definition Camera.hpp:28
Class for device.
Definition Device.hpp:35
Class for Gui.
Definition Gui.hpp:30
std::vector< unsigned int > m_lightsToRemove
Definition Gui.hpp:76
~Gui()=default
static void renderFrameWindow(const ClockData &clockData)
Definition render.cpp:39
static void cameraSection(Camera &camera)
Definition render.cpp:109
std::vector< unsigned int > * getLightsToRemove()
Definition Gui.hpp:55
ImGuiIO * m_io
Definition Gui.hpp:70
Gui(Gui &&)=delete
void init(GLFWwindow *window, VkInstance instance, const Device *device, VkRenderPass renderPass)
Definition init.cpp:6
static void initStyle()
Definition init.cpp:54
std::vector< unsigned int > m_objectsToRemove
Definition Gui.hpp:75
void lightsSection(SceneManager &sceneManager)
Definition render.cpp:185
static void rendererSection(Renderer *renderer, GlobalUbo &ubo)
Definition render.cpp:48
Gui & operator=(Gui &&)=delete
static void inputsSection(const ImGuiIO &io)
Definition render.cpp:282
GUI_STATE getState() const
Definition Gui.hpp:53
Gui & operator=(const Gui &)=delete
static void cleanup()
Definition render.cpp:11
Gui(const Gui &)=delete
static void devicePropertiesSection(VkPhysicalDeviceProperties deviceProperties)
Definition render.cpp:304
Gui()=default
void render(Renderer *renderer, SceneManager &sceneManager, Camera &camera, VkPhysicalDevice physicalDevice, GlobalUbo &ubo, const ClockData &clockData)
Definition render.cpp:18
float m_shininess
Definition Gui.hpp:73
float m_intensity
Definition Gui.hpp:72
GUI_STATE m_state
Definition Gui.hpp:71
std::vector< unsigned int > * getObjectsToRemove()
Definition Gui.hpp:54
void setState(const GUI_STATE state)
Definition Gui.hpp:52
void objectsSection(SceneManager &sceneManager)
Definition render.cpp:158
Class for renderer.
Definition Renderer.hpp:24
Class for object manager.
Definition Manager.hpp:19
static constexpr uint16_t DESCRIPTOR_COUNT
Definition Gui.hpp:17
static constexpr float DEFAULT_SHININESS
Definition Light.hpp:18
GUI_STATE
Definition Gui.hpp:19
@ SHOW_PLAYER
Definition Gui.hpp:21
@ SHOW_EDITOR
Definition Gui.hpp:20
@ HIDDEN
Definition Gui.hpp:22
float deltaTimeMS
Definition Gui.hpp:33
static bool IsLegacyNativeDupe(const ImGuiKey key)
Definition Gui.hpp:68