SDL_Quit -- shuts down SDL.


#include <SDL.h>

void SDL_Quit (void);


This function cleans up all initialized subsystems and unloads the dynamically linked library. You should call it upon all exit conditions.

Return Value

Returns nothing.

Note: You should call this function even if you have already shutdown each initialized subsystem with SDL_QuitSubSystem.

Note: 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, then you must use that subsystem's quit function(SDL_VideoQuit) to shut it down before calling SDL_Quit.

Note: You can use this function with atexit() to ensure that it is run when your application is shutdown, but it is not wise to do this from a library or other dynamically loaded code.


   1 #include <SDL.h>
   2 #include <stdio.h>
   4 int main(int argc, char** argv) {
   5     if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
   6         fprintf(stderr, "Unable to initialize SDL:  %s\n", SDL_GetError());
   7         return 1;
   8     }
   9     atexit(SDL_Quit);
  11     /* ... */
  13     return 0;
  14 }

See Also

SDL_Init, SDL_InitSubSystem, SDL_QuitSubSystem

CategorySDL13API CategorySDL13APIGeneral

SDL-1.3/SDL_Quit (last edited 2009-02-13 23:44:27 by KenBull)