clarify wiki: SDL_Init or SDL_InitSubSystem?

What is the recommended way to initialize SDL? There seems to be inconsistent advice in the wiki:

  • SDL2/SDL_Init: - SDL Wiki
    SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the two may be used interchangeably. Though for readability of your code SDL_InitSubSystem() might be preferred.

  • SDL2/SDL_Quit - SDL Wiki
    But generally, you should not be using those functions directly anyhow; use SDL_Init() instead.

I don’t see an inconsistency. The SDL_Init page talks about SDL_InitSubSystem. The quote from the SDL_Quit page that you posted is talking about the “subsystem’s init function” which is not the same as SDL_InitSubSystem (it mentions SDL_VideoInit as an example).

2 Likes

Aaaah right, my bad. Thanks!