Wiki Page Content

Differences between revisions 1 and 10 (spanning 9 versions)
Revision 1 as of 2010-05-09 06:28:43
Size: 1138
Editor: SheenaSmith
Comment: create page, add content (Wed Mar 10 ver; changeset 4428)
Revision 10 as of 2011-01-04 18:40:18
Size: 1748
Editor: SheenaSmith
Comment: minor change
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
||<tablewidth="100%" style="color: #FF0000;" :> DRAFT||
Line 6: Line 5:
Use this function to return ^a^ mask of the specified subsystems which have ^previously^ been initialized. Use this function to return a mask of the specified subsystems which have previously been initialized.
Line 19: Line 18:
If flags is 0, it returns a mask of all initialized subsystems. <<Color2(green,Otherwise it returns the initialization status of the specified subsystems. ?????)>> If '''flags''' is 0 it returns a mask of all initialized subsystems, otherwise it returns the initialization status of the specified subsystems.

The return value does not include SDL_INIT_EVENTTHREAD or SDL_INIT_NOPARACHUTE.
Line 23: Line 24:
You can add your code example here /* Get init data on all the subsystems */
Uint32 subsystem_init;

subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING);

if(subsystem_init&SDL_INIT_VIDEO)
  printf("Video is initialized.\n");
else
  printf("Video is not initialized.\n");
}}}
{{{#!highlight cpp
/* Just check for one specific subsystem */

if(SDL_WasInit(SDL_INIT_VIDEO)!=0)
  printf("Video is initialized.\n");
else
  printf("Video is not initialized.\n");
}}}
{{{#!highlight cpp
/* Check for two subsystems */

Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO;

if(SDL_WasInit(subsystem_mask)==subsystem_mask)
  printf("Video and Audio initialized.\n");
else
  printf("Video and Audio not initialized.\n");
Line 27: Line 54:
<<Anchor(flags)>>These are the flags which may be passed to [[SDL_WasInit]]() and may be OR'd together to query multiple, specific subsystems simultaneously.
<<Include(SDL_Init, , , from="OR'd together.", to="== Return Value ==")>>
<<Anchor(flags)>>These are the flags which may be passed to [[SDL_WasInit]]() and may be OR'd together to query multiple subsystems simultaneously.
Line 30: Line 56:
''You can add useful comments here'' <<Include(SDL_Init, , , from="OR'd together:", to="Unless the")>>

SDL_WasInit

Use this function to return a mask of the specified subsystems which have previously been initialized.

Syntax

Uint32 SDL_WasInit(Uint32 flags)

Function Parameters

flags

any of the flags used by SDL_Init(); see Remarks for details

Return Value

If flags is 0 it returns a mask of all initialized subsystems, otherwise it returns the initialization status of the specified subsystems.

The return value does not include SDL_INIT_EVENTTHREAD or SDL_INIT_NOPARACHUTE.

Code Examples

/* Get init data on all the subsystems */
Uint32 subsystem_init;

subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING);

if(subsystem_init&SDL_INIT_VIDEO)
  printf("Video is initialized.\n");
else
  printf("Video is not initialized.\n");

/* Just check for one specific subsystem */

if(SDL_WasInit(SDL_INIT_VIDEO)!=0)
  printf("Video is initialized.\n");
else
  printf("Video is not initialized.\n");

/* Check for two subsystems */

Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO;

if(SDL_WasInit(subsystem_mask)==subsystem_mask)
  printf("Video and Audio initialized.\n");
else
  printf("Video and Audio not initialized.\n");

Remarks

These are the flags which may be passed to SDL_WasInit() and may be OR'd together to query 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


CategoryAPI, CategoryInit


CategoryAPI, CategoryInit

None: SDL_WasInit (last edited 2016-05-14 22:29:46 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit