Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
UI.hpp
Go to the documentation of this file.
1
7#pragma once
8
9#include <memory>
10#include <vector>
11
12#include <glad/glad.h>
13#include <glm/glm.hpp>
14#define GL_SILENCE_DEPRECATION
15#include <GLFW/glfw3.h>
16
17#include <ECS/Registry.hpp>
20#include <UI/Widget.hpp>
21
22namespace shkyera {
23
29class UI {
30 public:
34 UI();
35
41 void initialize(std::shared_ptr<Registry> registry);
42
46 void draw();
47
51 void close();
52
58 bool shouldClose() const;
59
60 private:
64 void initializeImgui();
65
69 void initializeWidgets();
70
75
79 void styleImgui();
80
84 void beginFrame();
85
89 void renderFrame();
90
94 void endFrame();
95
96 std::shared_ptr<Registry> _registry;
97 std::vector<std::unique_ptr<Widget>> _widgets;
98
99 bool _open;
101};
102
103} // namespace shkyera
A class responsible for managing the user interface (UI) of the application.
Definition UI.hpp:29
std::vector< std::unique_ptr< Widget > > _widgets
A collection of UI widgets.
Definition UI.hpp:97
void draw()
Render the UI.
Definition UI.cpp:296
bool _open
Flag indicating if the UI is open.
Definition UI.hpp:99
void initializeImgui()
Initialize ImGui and other UI elements.
Definition UI.cpp:43
void styleImgui()
Apply styling to ImGui elements.
Definition UI.cpp:111
bool shouldClose() const
Check if the UI should be closed.
Definition UI.cpp:316
void beginFrame()
Begin a UI frame.
Definition UI.cpp:184
void initialize(std::shared_ptr< Registry > registry)
Initialize the systems and widgets.
Definition UI.cpp:33
GLFWwindow * _window
The UI window.
Definition UI.hpp:100
void renderFrame()
Render the UI frame.
Definition UI.cpp:246
void initializeWidgets()
Initialize UI widgets.
Definition UI.cpp:93
void endFrame()
End the UI frame.
Definition UI.cpp:279
void close()
Close and clean up the UI.
Definition UI.cpp:307
void initializeAssets()
Initialize UI assets.
UI()
Constructor to create a UI manager for the specified game.
Definition UI.cpp:28
std::shared_ptr< Registry > _registry
A shared pointer to the associated game.
Definition UI.hpp:96
Definition Asset.hpp:6
Definition Clock.hpp:9