1SDL_WasInit(3)                 SDL API Reference                SDL_WasInit(3)
2
3
4

NAME

6       SDL_WasInit - Check which subsystems are initialized
7

SYNOPSIS

9       #include "SDL.h"
10
11       Uint32 SDL_WasInit(Uint32 flags);
12

DESCRIPTION

14       SDL_WasInit  allows  you  to see which SDL subsytems have been initial‐
15       ized. flags is a bitwise OR'd combination of the subsystems you wish to
16       check (see SDL_Init for a list of subsystem flags).
17

RETURN VALUE

19       SDL_WasInit returns a bitwised OR'd combination of the initialized sub‐
20       systems.
21

EXAMPLES

23       /* Here are several ways you can use SDL_WasInit() */
24
25       /* Get init data on all the subsystems */
26       Uint32 subsystem_init;
27
28       subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING);
29
30       if(subsystem_init&SDL_INIT_VIDEO)
31         printf("Video is initialized.
32       ");
33       else
34         printf("Video is not initialized.
35       ");
36
37
38
39       /* Just check for one specfic subsystem */
40
41       if(SDL_WasInit(SDL_INIT_VIDEO)!=0)
42         printf("Video is initialized.
43       ");
44       else
45         printf("Video is not initialized.
46       ");
47
48
49
50
51       /* Check for two subsystems */
52
53       Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO;
54
55       if(SDL_WasInit(subsystem_mask)==subsystem_mask)
56         printf("Video and Audio initialized.
57       ");
58       else
59         printf("Video and Audio not initialized.
60       ");
61

SEE ALSO

63       SDL_Init, SDL_Subsystem
64
65
66
67SDL                         Tue 11 Sep 2001, 23:00              SDL_WasInit(3)
Impressum