Manages ImGui contexts for UI rendering. More...
#include <imgui_manager.h>
Public Member Functions | |
ImGuiManager (IWindowManager *windowManager, IConfigService *configService) | |
Constructs a ImGuiManager for the main application. | |
ImGuiManager (SDL_Window *window, SDL_Renderer *renderer, IConfigService *configService) | |
Constructs a ImGuiManager for standalone initial configuration. | |
~ImGuiManager () | |
Destroys the ImGuiManager instance. | |
void | initialize () |
Initializes the ImGui context. | |
void | newFrame () |
Starts a new ImGui frame. | |
void | render (SDL_Renderer *renderer) |
Renders ImGui draw data. | |
void | processEvent (const SDL_Event &event) |
Processes an SDL event for ImGui. | |
Manages ImGui contexts for UI rendering.
This class initializes and manages ImGui contexts for rendering UI elements in two modes: the main application (using IWindowManager for playfield, backglass, and DMD windows) and standalone initial configuration (using a single SDL window and renderer). It handles SDL event processing and ImGui rendering, integrating with IConfigService for settings.
ImGuiManager::ImGuiManager | ( | IWindowManager * | windowManager, |
IConfigService * | configService | ||
) |
Constructs a ImGuiManager for the main application.
Initializes the ImGui context for the main application using the provided window manager and configuration service.
windowManager | The window manager for accessing SDL windows and renderers. |
configService | The configuration service for accessing settings. |
ImGuiManager::ImGuiManager | ( | SDL_Window * | window, |
SDL_Renderer * | renderer, | ||
IConfigService * | configService | ||
) |
Constructs a ImGuiManager for standalone initial configuration.
Initializes the ImGui context for initial configuration using a single SDL window and renderer, with the provided configuration service.
window | The SDL window for the configuration UI. |
renderer | The SDL renderer for the configuration UI. |
configService | The configuration service for accessing settings. |
ImGuiManager::~ImGuiManager | ( | ) |
Destroys the ImGuiManager instance.
Cleans up the ImGui context and any associated resources.
void ImGuiManager::initialize | ( | ) |
Initializes the ImGui context.
Sets up the ImGui context for rendering, configuring it for the main application or initial configuration mode.
void ImGuiManager::newFrame | ( | ) |
Starts a new ImGui frame.
Prepares ImGui for a new rendering frame, updating internal state for UI elements.
void ImGuiManager::processEvent | ( | const SDL_Event & | event | ) |
Processes an SDL event for ImGui.
Forwards the provided SDL event to ImGui for handling UI interactions (e.g., mouse clicks, keyboard input).
event | The SDL event to process. |
void ImGuiManager::render | ( | SDL_Renderer * | renderer | ) |
Renders ImGui draw data.
Renders the ImGui UI elements to the specified SDL renderer.
renderer | The SDL renderer to use for rendering ImGui draw data. |