From dfb464ea7b93a2cb97b7afc5ee7acaf74b79c26d Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Sun, 27 Jul 2014 00:30:26 +0400 Subject: [PATCH] Implement init/deinit/check of separate SDL subsystems --- SDL2pp/SDL.cc | 13 +++++++++++++ SDL2pp/SDL.hh | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/SDL2pp/SDL.cc b/SDL2pp/SDL.cc index 7ed8815..d63f0a8 100644 --- a/SDL2pp/SDL.cc +++ b/SDL2pp/SDL.cc @@ -35,4 +35,17 @@ SDL::~SDL() { SDL_Quit(); } +Uint32 WasInit(Uint32 flags) { + return SDL_WasInit(flags); +} + +void InitSubsystem(Uint32 flags) { + if (SDL_InitSubSystem(flags) != 0) + throw Exception("SDL_InitSubsystem failed"); +} + +void QuitSubSystem(Uint32 flags) { + SDL_QuitSubSystem(flags); +} + } diff --git a/SDL2pp/SDL.hh b/SDL2pp/SDL.hh index cb5edb0..cd63bb6 100644 --- a/SDL2pp/SDL.hh +++ b/SDL2pp/SDL.hh @@ -35,6 +35,10 @@ public: SDL(SDL&& other) = delete; SDL& operator=(const SDL& other) = delete; SDL& operator=(SDL&& other) = delete; + + Uint32 WasInit(Uint32 flags); + void InitSubSystem(Uint32 flags); + void QuitSubSystem(Uint32 flags); }; }