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

Manages SDL windows and renderers for VPX displays. More...

#include <window_manager.h>

+ Inheritance diagram for WindowManager:
+ Collaboration diagram for WindowManager:

Public Member Functions

 WindowManager (const Settings &settings)
 Constructs a WindowManager instance.
 
 ~WindowManager ()=default
 Destroys the WindowManager instance.
 
SDL_Window * getPlayfieldWindow () override
 Gets the playfield window.
 
SDL_Window * getBackglassWindow () override
 Gets the backglass window.
 
SDL_Window * getDMDWindow () override
 Gets the DMD window.
 
SDL_Window * getTopperWindow () override
 Gets the topper window.
 
SDL_Renderer * getPlayfieldRenderer () override
 Gets the playfield renderer.
 
SDL_Renderer * getBackglassRenderer () override
 Gets the backglass renderer.
 
SDL_Renderer * getDMDRenderer () override
 Gets the DMD renderer.
 
SDL_Renderer * getTopperRenderer () override
 Gets the topper renderer.
 
void updateWindows (const Settings &settings) override
 Updates windows with new settings.
 
void getWindowSetup (int &playfieldX, int &playfieldY, int &playfieldWidth, int &playfieldHeight, int &backglassX, int &backglassY, int &backglassWidth, int &backglassHeight, int &dmdX, int &dmdY, int &dmdWidth, int &dmdHeight, int &topperX, int &topperY, int &topperWidth, int &topperHeight) override
 Gets the positions of all windows.
 
- Public Member Functions inherited from IWindowManager
virtual ~IWindowManager ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Detailed Description

Manages SDL windows and renderers for VPX displays.

This class implements the IWindowManager interface to create, manage, and update SDL windows and renderers for the playfield, backglass, DMD, and topper displays. It uses application settings to configure window properties and supports DPI scaling.

Constructor & Destructor Documentation

◆ WindowManager()

WindowManager::WindowManager ( const Settings settings)
explicit

Constructs a WindowManager instance.

Initializes SDL windows and renderers for the playfield, backglass, DMD, and topper displays based on the provided settings.

Parameters
settingsThe application settings for window configuration.
+ Here is the call graph for this function:

◆ ~WindowManager()

WindowManager::~WindowManager ( )
default

Destroys the WindowManager instance.

Default destructor, no special cleanup required (managed by smart pointers).

Member Function Documentation

◆ getBackglassRenderer()

SDL_Renderer * WindowManager::getBackglassRenderer ( )
inlineoverridevirtual

Gets the backglass renderer.

Returns
The SDL renderer for the backglass, or nullptr if not available.

Implements IWindowManager.

◆ getBackglassWindow()

SDL_Window * WindowManager::getBackglassWindow ( )
inlineoverridevirtual

Gets the backglass window.

Returns
The SDL window for the backglass, or nullptr if not available.

Implements IWindowManager.

◆ getDMDRenderer()

SDL_Renderer * WindowManager::getDMDRenderer ( )
inlineoverridevirtual

Gets the DMD renderer.

Returns
The SDL renderer for the DMD, or nullptr if not available.

Implements IWindowManager.

◆ getDMDWindow()

SDL_Window * WindowManager::getDMDWindow ( )
inlineoverridevirtual

Gets the DMD window.

Returns
The SDL window for the DMD, or nullptr if not available.

Implements IWindowManager.

◆ getPlayfieldRenderer()

SDL_Renderer * WindowManager::getPlayfieldRenderer ( )
inlineoverridevirtual

Gets the playfield renderer.

Returns
The SDL renderer for the playfield, or nullptr if not available.

Implements IWindowManager.

◆ getPlayfieldWindow()

SDL_Window * WindowManager::getPlayfieldWindow ( )
inlineoverridevirtual

Gets the playfield window.

Returns
The SDL window for the playfield, or nullptr if not available.

Implements IWindowManager.

◆ getTopperRenderer()

SDL_Renderer * WindowManager::getTopperRenderer ( )
inlineoverridevirtual

Gets the topper renderer.

Returns
The SDL renderer for the topper, or nullptr if not available.

Implements IWindowManager.

◆ getTopperWindow()

SDL_Window * WindowManager::getTopperWindow ( )
inlineoverridevirtual

Gets the topper window.

Returns
The SDL window for the topper, or nullptr if not available.

Implements IWindowManager.

◆ getWindowSetup()

void WindowManager::getWindowSetup ( int &  playfieldX,
int &  playfieldY,
int &  playfieldWidth,
int &  playfieldHeight,
int &  backglassX,
int &  backglassY,
int &  backglassWidth,
int &  backglassHeight,
int &  dmdX,
int &  dmdY,
int &  dmdWidth,
int &  dmdHeight,
int &  topperX,
int &  topperY,
int &  topperWidth,
int &  topperHeight 
)
overridevirtual

Gets the positions of all windows.

Retrieves the x and y coordinates of the playfield, backglass, DMD, and topper windows.

Parameters
playfieldXThe x-coordinate of the playfield window.
playfieldYThe y-coordinate of the playfield window.
backglassXThe x-coordinate of the backglass window.
backglassYThe y-coordinate of the backglass window.
dmdXThe x-coordinate of the DMD window.
dmdYThe y-coordinate of the DMD window.
topperXThe x-coordinate of the topper window.
topperYThe y-coordinate of the topper window.

Implements IWindowManager.

◆ updateWindows()

void WindowManager::updateWindows ( const Settings settings)
overridevirtual

Updates windows with new settings.

Reconfigures the playfield, backglass, DMD, and topper windows and renderers based on the provided application settings.

Parameters
settingsThe application settings to apply.

Implements IWindowManager.

+ Here is the caller graph for this function:

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