|
Size: 1147
Comment: temp repair of include (waiting for final SDL_Init)
|
Size: 1686
Comment: update content (old wiki); repaired include from SDL_Init
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 20: | Line 20: |
| *<<BR>><<Color2(green,Old wiki says error code is -1. Is it still?)>><<BR>>* |
|
| Line 22: | Line 24: |
| You can add your code example here | /* Separating Joystick and Video initialization. */ SDL_Init(SDL_INIT_VIDEO); . . SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN); . /* 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(); |
| Line 27: | Line 46: |
| <<Include(SDL_Init, , , from="initiate multiple subsystems.", to="This function loads")>> | <<Include(SDL_Init, , , from="OR'd together:", to="Unless the")>> *<<BR>>After SDL has been initialized with [[SDL_Init]]() you may initialize uninitialized subsystems with [[SDL_InitSubSystem]]().<<BR>>* |
| Line 33: | Line 54: |
| .[[SDL_Quit]] |
SDL_InitSubSystem
Use this function to initialize specific SDL subsystems.
Contents
Syntax
int SDL_InitSubSystem(Uint32 flags)
Function Parameters
Return Value
Returns 0 on success, or a negative error code on failure; call SDL_GetError() for more information.
*
green
*
Code Examples
/* Separating Joystick and Video initialization. */
SDL_Init(SDL_INIT_VIDEO);
.
.
SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN);
.
/* 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();
Remarks
These are the flags which may be passed to SDL_InitSubSystem() and may be OR'd together to initialize multiple subsystems simultaneously.
Include: Nothing found for "Unless the"!
SDL_INIT_TIMER |
timer subsystem |
SDL_INIT_AUDIO |
audio subsystem |
SDL_INIT_VIDEO |
video subsystem; automatically initializes the events subsystem |
SDL_INIT_JOYSTICK |
joystick subsystem; automatically initializes the events subsystem |
SDL_INIT_HAPTIC |
haptic (force feedback) subsystem |
SDL_INIT_GAMECONTROLLER |
controller subsystem; automatically initializes the joystick subsystem |
SDL_INIT_EVENTS |
events subsystem |
SDL_INIT_EVERYTHING |
all of the above subsystems |
SDL_INIT_NOPARACHUTE |
compatibility; this flag is ignored |
If you want to initialize subsystems separately you would call SDL_Init(0) followed by SDL_InitSubSystem() with the desired subsystem flag.
Related Functions
*
After SDL has been initialized with SDL_Init() you may initialize uninitialized subsystems with SDL_InitSubSystem().
*
SDL_Init() initializes assertions and crash protection and then calls SDL_InitSubSystem(). If you want to bypass those protections you can call SDL_InitSubSystem() directly.
