Shut down specific SDL subsystems.
Defined in <SDL3/SDL_init.h>
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 <SDL3/SDL.h>
extern void display_graph(void);
/* ... */
int main(int argc, char **argv) {
int sdl_initialized = 0;
sdl_initialized = !SDL_Init(0);
/* ... 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;
}