SDL Wiki
(This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)


Shut down specific SDL subsystems.


void SDL_QuitSubSystem(Uint32 flags);

Function Parameters


any of the flags used by SDL_Init(); see SDL_Init for details.


If you start a subsystem using a call to that subsystem's init function (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(), SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use that subsystem's quit function (SDL_VideoQuit()) directly instead. But generally, you should not be using those functions directly anyhow; use SDL_Init() instead.

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.

Code Examples

#include "SDL.h"

/* ... */

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)) {

    /* ... more console stuff ... */

    if (sdl_initialized) SDL_Quit();
    return 0;

CategoryAPI, CategoryInit

[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.