ASAPCabinetFE
 
Loading...
Searching...
No Matches
SDLBootstrap Struct Reference

RAII struct for initializing and cleaning up SDL subsystems. More...

+ Collaboration diagram for SDLBootstrap:

Public Member Functions

 SDLBootstrap ()
 Constructs an SDLBootstrap and initializes GST and SDL subsystems.
 
 ~SDLBootstrap ()
 Destroys the SDLBootstrap and cleans up SDL subsystems.
 

Public Attributes

std::string configPath
 Configuration file path.
 

Detailed Description

RAII struct for initializing and cleaning up SDL subsystems.

This struct initializes GST, SDL, SDL_ttf, and SDL_image with required subsystems (video, events, joystick, audio) and configures DPI awareness. It logs errors using LOG_ERROR and throws exceptions on failure. Cleanup is performed automatically on destruction.

Constructor & Destructor Documentation

◆ SDLBootstrap()

SDLBootstrap::SDLBootstrap ( )
inline

Constructs an SDLBootstrap and initializes GST and SDL subsystems.

Initializes SDL with video, events, joystick, and audio subsystems, retrieves system DPI, sets DPI awareness hints, and initializes SDL_ttf, SDL_image, and GStreamer. Logs errors and throws runtime_error on failure.

Exceptions
std::runtime_errorIf GST, SDL, SDL_ttf, or SDL_image initialization fails.

◆ ~SDLBootstrap()

SDLBootstrap::~SDLBootstrap ( )
inline

Destroys the SDLBootstrap and cleans up SDL subsystems.

Cleans up SDL_image, SDL_ttf, and SDL subsystems, logging the cleanup process. Also quits and joins the GStreamer event loop thread gracefully.


The documentation for this struct was generated from the following file: