Manages UI lifecycle, panels, and rendering for both editor and runtime. More...
#include <UIManager.h>
Public Member Functions | |
| FRAMEWORK_API void | Init () |
| Initializes UI resources and prepares the ImGui renderer. | |
| FRAMEWORK_API void | Shutdown () |
| Cleans up resources and shuts down the UI system. | |
| FRAMEWORK_API void | Begin () |
| Begins a new UI frame, setting up ImGui and framebuffers. | |
| FRAMEWORK_API void | End () |
| Ends the current UI frame, finalizing ImGui rendering. | |
| FRAMEWORK_API void | DrawUI () |
| Draws all registered UI panels and menu bars. | |
| FRAMEWORK_API void | AddPanel (const std::string &panelName, const std::function< void(UIPanelContext &)> &callback, bool startVisible=true) |
| Registers a UI panel. | |
| FRAMEWORK_API void | AddMenuBar (float height, const std::function< void(UIPanelContext &)> &callback) |
| Registers a menu bar callback. | |
| void | AddDockspace (bool enabled) |
| Enables or disables ImGui dockspace for UI layout. | |
| FRAMEWORK_API void | TogglePanelVisibility (std::string_view panelName) |
| Toggles the visibility state of a registered panel. | |
| void | SetScene (Scene &scene) |
| Sets the active scene pointer for UI context. | |
| FRAMEWORK_API void | DeferResourceCleanup (const std::function< void()> &fn) |
| Enqueues a function to be called during ImGui cleanup. | |
| FRAMEWORK_API void | SetImGuiStyle () |
| Configures ImGui style settings to the engine's preferred theme. | |
| ImGuiContext * | GetContext () |
Manages UI lifecycle, panels, and rendering for both editor and runtime.
Handles initialization, rendering, and shutdown of the UI system. Supports panel registration with visibility scopes, menu bars, dockspaces, and deferred resource cleanup.
|
inline |
| void Raven::UIManager::AddMenuBar | ( | float | height, |
| const std::function< void(UIPanelContext &)> & | callback ) |
Registers a menu bar callback.
Only one menu bar can be active at a time.
| height | Height of the menu bar in pixels. |
| callback | Function invoked to render the menu bar. |
| void Raven::UIManager::AddPanel | ( | const std::string & | panelName, |
| const std::function< void(UIPanelContext &)> & | callback, | ||
| bool | startVisible = true ) |
Registers a UI panel.
| panelName | Name identifier for the panel. |
| callback | Function invoked every frame to render panel contents. |
| startVisible | Set the starting Visibility. |
| void Raven::UIManager::DeferResourceCleanup | ( | const std::function< void()> & | fn | ) |
Enqueues a function to be called during ImGui cleanup.
Used for deferred resource cleanup tasks.
| fn | Function to execute later. |
| void Raven::UIManager::DrawUI | ( | ) |
Draws all registered UI panels and menu bars.
|
inline |
| void Raven::UIManager::SetImGuiStyle | ( | ) |
|
inline |
| void Raven::UIManager::Shutdown | ( | ) |
Cleans up resources and shuts down the UI system.
| void Raven::UIManager::TogglePanelVisibility | ( | std::string_view | panelName | ) |
Toggles the visibility state of a registered panel.
| panelName | Name of the panel to toggle. |