13 #include <imgui_internal.h>
21 static const ImVec2 DEBUG_MENU_DEFAULT_WINDOW_SIZE = ImVec2((
float)500, (
float)500);
22 static const float DEFAULT_COMPONENT_LIST_HEIGHT = 150.0f;
23 static const float DEFAULT_EVENT_LOG_HEIGHT = 200.0f;
24 static const size_t DEFAULT_FPS_PLOT_TEXT_LENGTH = 32;
25 static const size_t DEFAULT_FPS_PLOT_NB_VALUES = 90;
26 static const double DEFAULT_FPS_PLOT_REFRESH_RATE = 60.0;
27 static const ImVec2 DEFAULT_FPS_PLOT_SIZE = ImVec2(0, 80.0f);
28 static const int DEFAULT_FPS_LIMIT_SLIDER_MAX_VALUE = 1000;
29 static const int DEFAULT_FPS_LIMIT_SLIDER_VALUE = 60;
40 : _eventManager(eventManager), _registry(registry), _deltaTime(deltaTime)
49 ImGui::SetNextWindowSize(DEBUG_MENU_DEFAULT_WINDOW_SIZE, ImGuiCond_FirstUseEver);
50 ImGui::Begin(
"Debug Menu");
51 if (ImGui::BeginTabBar(
"MainTabBar")) {
52 if (ImGui::BeginTabItem(
"Game")) {
55 if (ImGui::BeginTabItem(
"Registry")) {
58 if (ImGui::BeginTabItem(
"Events")) {
73 void _showRegistryMenu();
78 template <
typename Component>
81 if (ImGui::BeginListBox(
"##componentList",
82 ImVec2(ImGui::GetContentRegionAvail().x / 3.0f, DEFAULT_COMPONENT_LIST_HEIGHT))) {
83 for (
int i = 0; i < _registry._nbEntities; i++) {
86 const bool is_selected = (currentComponent == i);
87 if (ImGui::Selectable(std::to_string(i).c_str(), is_selected)) {
91 ImGui::SetItemDefaultFocus();
97 void _showTransfomComponentMenu();
99 void _showTextureComponentMenu();
101 void _showCameraComponentMenu();
103 void _showCollisionComponentMenu();
105 void _showMusicComponentMenu();
107 void _showPressableComponentMenu();
109 void _showTextComponentMenu();
111 void _showControllableComponentMenu();
113 void _showDamageComponentMenu();
115 void _showGravityComponentMenu();
117 void _showInputComponentMenu();
119 void _showHealthComponentMenu();
121 void _showScoreComponentMenu();
123 void _showNetworkIdComponentMenu();
125 void _showEventsMenu();
DeltaTime class which handles the delta time.
Definition: DeltaTime.hpp:16
class to help create and manage all the event handlers
Definition: Event.hpp:135
Entity component system, handling entities, components and systems.
Definition: Registry.hpp:31
Array which can have empty indexes.
Definition: SparseArray.hpp:19
Definition: Registry.hpp:21