.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_Init: .\" https://wiki.libsdl.org/SDL_Init .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_Init .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_Init 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_Init \- Initialize the SDL library\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "int SDL_Init(Uint32 flags); .fi .SH DESCRIPTION .BR SDL_Init () simply forwards to calling .BR SDL_InitSubSystem ()\[char46] Therefore, the two may be used interchangeably\[char46] Though for readability of your code .BR SDL_InitSubSystem () might be preferred\[char46] The file I/O (for example: .BR SDL_IOFromFile ) and threading ( .BR SDL_CreateThread ) subsystems are initialized by default\[char46] Message boxes ( .BR SDL_ShowSimpleMessageBox ) also attempt to work without initializing the video subsystem, in hopes of being useful in showing an error dialog when .BR SDL_Init fails\[char46] You must specifically initialize other subsystems if you use them in your application\[char46] Logging (such as .BR SDL_Log ) works without initialization, too\[char46] .BR flags may be any of the following OR'd together: \(bu .BR .BR SDL_INIT_TIMER : timer subsystem \(bu .BR .BR SDL_INIT_AUDIO : audio subsystem \(bu .BR .BR SDL_INIT_VIDEO : video subsystem; automatically initializes the events subsystem \(bu .BR .BR SDL_INIT_JOYSTICK : joystick subsystem; automatically initializes the events subsystem \(bu .BR .BR SDL_INIT_HAPTIC : haptic (force feedback) subsystem \(bu .BR .BR SDL_INIT_GAMEPAD : gamepad subsystem; automatically initializes the joystick subsystem \(bu .BR .BR SDL_INIT_EVENTS : events subsystem \(bu .BR .BR SDL_INIT_SENSOR : sensor subsystem Subsystem initialization is ref-counted, you must call .BR SDL_QuitSubSystem () for each .BR SDL_InitSubSystem () to correctly shutdown a subsystem manually (or call .BR SDL_Quit () to force shutdown)\[char46] If a subsystem is already loaded then this call will increase the ref-count and return\[char46] .SH FUNCTION PARAMETERS .TP .I flags subsystem initialization flags .SH RETURN VALUE Returns 0 on success or a negative error code on failure; call .BR SDL_GetError () for more information\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_InitSubSystem (3), .BR SDL_Quit (3), .BR SDL_SetMainReady (3), .BR SDL_WasInit (3)