Init, errors & main callbacksSDL 3.2
SDL_Quit
Shuts down every SDL subsystem that is still running. The last SDL call of a program.
Signature
void SDL_Quit(void);
How it works
Destroy your own objects first (textures, renderer, window), then call SDL_Quit. It restores the screen mode if you changed it and releases the devices SDL opened.
It is safe to call even when SDL_Init failed, so an early return path can call it too.
Tips & pitfalls
With the
SDL_AppInitcallbacks, SDL callsSDL_Quitfor you afterSDL_AppQuitreturns.
Example
example.cpp
1SDL_DestroyTexture(sprite);
2SDL_DestroyRenderer(renderer);
3SDL_DestroyWindow(window);
4SDL_Quit();