Compatibility function to initialize the SDL library.
Defined in <SDL3/SDL_init.h>
flags | any of the flags used by SDL_Init(); see SDL_Init for details. |
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
This function and SDL_Init() are interchangeable.
This function is available since SDL 3.0.0.
/* Separating Joystick and Video initialization. */
SDL_Init(SDL_INIT_VIDEO);
SDL_Window* window = SDL_CreateWindow("A Window",
640, 480,
SDL_WINDOW_FULLSCREEN);
SDL_Renderer* renderer = SDL_CreateRenderer(window, NULL);
/* Do Some Video stuff */
/* Initialize the joystick subsystem */
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
/* Do some stuff with video and joystick */
/* Shut them both down */
SDL_Quit();