Shut down specific SDL subsystems.
void SDL_QuitSubSystem(Uint32 flags);
flags | any of the flags used by SDL_Init(); see SDL_Init for details. |
You still need to call SDL_Quit() even if you close all open subsystems with SDL_QuitSubSystem().
This function is available since SDL 3.0.0.
#include "SDL.h"
/* ... */
int main(int argc, char **argv) {
int sdl_initialized = 0;
0);
sdl_initialized = !SDL_Init(
/* ... console stuff ... */
if (sdl_initialized && SDL_InitSubSystem(SDL_INIT_VIDEO)) {
display_graph();
SDL_QuitSubSystem(SDL_INIT_VIDEO);
}
/* ... more console stuff ... */
if (sdl_initialized) SDL_Quit();
return 0;
}