This function loads the SDL dynamically linked library and initializes the subsystems specified by 'flags' (and those satisfying dependencies). Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup signal handlers for some commonly ignored fatal signals (like SIGSEGV).
These are the flags which may be passed to SDL_Init() -- you should specify the subsystems which you will be using in your application:
SDL_INIT_TIMER
Initialize timer subsystem
SDL_INIT_AUDIO
Initialize audio subsystem
SDL_INIT_VIDEO
Initialize video subsystem
SDL_INIT_CDROM
Initialize CD-ROM subsystem
SDL_INIT_JOYSTICK
Initialize joystick subsystem
SDL_INIT_HAPTIC
Initialize haptic (force feedback) subsystem
SDL_INIT_EVERYTHING
Initialize all of the above subsystems
SDL_INIT_NOPARACHUTE
Don't catch fatal signals
SDL_INIT_EVENTTHREAD
Run the event loop in a separate thread (not supported by all OSs)
SDL_Init initializes the SDL library. This must be called before using any other SDL function.
You can call SDL_Init(0) or SDL_Init(SDL_INIT_NOPARACHUTE) to initialize SDL without initializing any subsystems.
Partager