ASAPCabinetFE
 
Loading...
Searching...
No Matches
ImGuiManager Class Reference

Manages ImGui contexts for UI rendering. More...

#include <imgui_manager.h>

+ Collaboration diagram for ImGuiManager:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ImGuiManager() [1/2]

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.

Parameters
windowManagerThe window manager for accessing SDL windows and renderers.
configServiceThe configuration service for accessing settings.

◆ ImGuiManager() [2/2]

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.

Parameters
windowThe SDL window for the configuration UI.
rendererThe SDL renderer for the configuration UI.
configServiceThe configuration service for accessing settings.

◆ ~ImGuiManager()

ImGuiManager::~ImGuiManager ( )

Destroys the ImGuiManager instance.

Cleans up the ImGui context and any associated resources.

Member Function Documentation

◆ initialize()

void ImGuiManager::initialize ( )

Initializes the ImGui context.

Sets up the ImGui context for rendering, configuring it for the main application or initial configuration mode.

+ Here is the call graph for this function:

◆ newFrame()

void ImGuiManager::newFrame ( )

Starts a new ImGui frame.

Prepares ImGui for a new rendering frame, updating internal state for UI elements.

◆ processEvent()

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).

Parameters
eventThe SDL event to process.

◆ render()

void ImGuiManager::render ( SDL_Renderer *  renderer)

Renders ImGui draw data.

Renders the ImGui UI elements to the specified SDL renderer.

Parameters
rendererThe SDL renderer to use for rendering ImGui draw data.

The documentation for this class was generated from the following files: