RAII struct for initializing and cleaning up SDL subsystems. More...
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. | |
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.
|
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.
std::runtime_error | If GST, SDL, SDL_ttf, or SDL_image initialization fails. |
|
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.