Chapter 5. General

Table of Contents
SDL_Init -- Initializes SDL
SDL_InitSubSystem -- Initialize subsystems
SDL_QuitSubSystem -- Shut down a subsystem
SDL_Quit -- Shut down SDL
SDL_WasInit -- Check which subsystems are initialized
SDL_GetError -- Get SDL error string
SDL_envvars -- SDL environment variables

Before SDL can be used in a program it must be initialized with SDL_Init. SDL_Init initializes all the subsystems that the user requests (video, audio, joystick, timers and/or cdrom). Once SDL is initialized with SDL_Init subsystems can be shut down and initialized as needed using SDL_InitSubSystem and SDL_QuitSubSystem.

SDL must also be shut down before the program exits to make sure it cleans up correctly. Calling SDL_Quit shuts down all subsystems and frees any resources allocated to SDL.