Implement init/deinit/check of separate SDL subsystems

This commit is contained in:
Dmitry Marakasov 2014-07-27 00:30:26 +04:00
parent d4426eb36a
commit dfb464ea7b
2 changed files with 17 additions and 0 deletions

View File

@ -35,4 +35,17 @@ SDL::~SDL() {
SDL_Quit(); 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);
}
} }

View File

@ -35,6 +35,10 @@ public:
SDL(SDL&& other) = delete; SDL(SDL&& other) = delete;
SDL& operator=(const SDL& other) = delete; SDL& operator=(const SDL& other) = delete;
SDL& operator=(SDL&& other) = delete; SDL& operator=(SDL&& other) = delete;
Uint32 WasInit(Uint32 flags);
void InitSubSystem(Uint32 flags);
void QuitSubSystem(Uint32 flags);
}; };
} }