Elaztek Developer Hub
Blamite Game Engine - blam!  00423.10.27.24.0533.blamite
The core library for the Blamite Game Engine.
imgui.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL2/SDL_events.h>
4 #include <map>
5 
8 
18 #define duigvs(x) Blam::UI::ImGUI::GetVisibility(x)
19 
20 #ifndef BLAM
21 #define BLAM
22 #endif
23 
32 {
33 public:
34  bool show = false;
35 
43  virtual void Draw() {};
44 };
45 
49 namespace Blam::UI::ImGUI
50 {
59  BLAM BlamResult Initialize();
60 
64  BLAM void RenderFrame();
65 
69  BLAM void EndFrame();
70 
74  BLAM void Shutdown();
75 
81  BLAM void ProcessSDLEvent(SDL_Event event);
82 
86  BLAM void BuildWindows();
87 
91  BLAM void RenderWindows();
92 
96  BLAM void CleanupWindows();
97 
105  BLAM bool* GetVisibility(std::string key);
106 
113  BLAM void AddToWindowList(std::string key, BlamImGuiWindow* group);
114 
122  BLAM BlamImGuiWindow* GetImGuiWindow(std::string key);
123 
130  BLAM void ShowErrorDialog(const char* title, const char* message);
131 
138  BLAM std::map<std::string, BlamImGuiWindow*>* GetWindowList();
139 }
Blam::UI::ImGUI::CleanupWindows
BLAM void CleanupWindows()
Cleans up any data used by the ImGUI draw list.
Definition: debug_ui.cpp:143
BlamImGuiWindow::Draw
virtual void Draw()
Draws the contents of the group.
Definition: imgui.h:43
BlamImGuiWindow::show
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: imgui.h:34
imgui.h
Blam::UI::ImGUI::RenderFrame
BLAM void RenderFrame()
Renders ImGUI to the application window.
Definition: imgui.cpp:157
Blam::UI::ImGUI::ProcessSDLEvent
BLAM void ProcessSDLEvent(SDL_Event event)
Passes an SDL event to ImGUI for proper handling.
Definition: imgui.cpp:216
Blam::UI::ImGUI::EndFrame
BLAM void EndFrame()
Ends ImGUI drawing for the current frame.
Definition: imgui.cpp:188
BlamImGuiWindow
Class representing an ImGUI window.
Definition: imgui.h:31
Blam::UI::ImGUI::Initialize
BLAM BlamResult Initialize()
Initialize ImGUI.
Definition: imgui.cpp:21
errors.h
Blam::UI::ImGUI::AddToWindowList
BLAM void AddToWindowList(std::string key, BlamImGuiWindow *group)
Adds a new item to the ImGUI draw list.
Definition: debug_ui.cpp:176
Blam::UI::ImGUI::ShowErrorDialog
BLAM void ShowErrorDialog(const char *title, const char *message)
Shows a simple error dialog created using ImGUI.
Definition: debug_ui.cpp:167
BLAM
#define BLAM
Definition: imgui.h:21
Blam::UI::ImGUI::GetWindowList
BLAM std::map< std::string, BlamImGuiWindow * > * GetWindowList()
Retrieves the current ImGUI drawing list.
Definition: debug_ui.cpp:188
Blam::UI::ImGUI::RenderWindows
BLAM void RenderWindows()
Renders all ImGUI data.
Definition: debug_ui.cpp:155
Blam::UI::ImGUI::BuildWindows
BLAM void BuildWindows()
Initializes the ImGUI draw list.
Definition: debug_ui.cpp:85
Blam::UI::ImGUI::Shutdown
BLAM void Shutdown()
Shuts down ImGUI and cleans up any data related to it.
Definition: imgui.cpp:196
Blam::UI::ImGUI::GetImGuiWindow
BLAM BlamImGuiWindow * GetImGuiWindow(std::string key)
Retrieves a drawing group with the specified ID.
Definition: debug_ui.cpp:193
SDL_Event
Definition: SdlEmulationLayer.h:735
Blam::UI::ImGUI::GetVisibility
BLAM bool * GetVisibility(std::string key)
Retrieves the visibility of the specified draw list item.
Definition: debug_ui.cpp:205
Blam::UI::ImGUI
Namespace for anything related to ImGUI.
Definition: imgui.h:49