author | Sam Lantinga <slouken@lokigames.com> |
Thu, 26 Apr 2001 16:45:43 +0000 | |
changeset 0 | 74212992fb08 |
child 55 | 55f1f1b3e27d |
permissions | -rw-r--r-- |
slouken@0 | 1 |
.TH "SDL_WasInit" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference" |
slouken@0 | 2 |
.SH "NAME" |
slouken@0 | 3 |
SDL_WasInit\- Check which subsystems are initialized |
slouken@0 | 4 |
.SH "SYNOPSIS" |
slouken@0 | 5 |
.PP |
slouken@0 | 6 |
\fB#include "SDL\&.h" |
slouken@0 | 7 |
.sp |
slouken@0 | 8 |
\fBUint32 \fBSDL_WasInit\fP\fR(\fBUint32 flags\fR); |
slouken@0 | 9 |
.SH "DESCRIPTION" |
slouken@0 | 10 |
.PP |
slouken@0 | 11 |
\fBSDL_WasInit\fP allows you to see which SDL subsytems have been \fIinitialized\fR\&. \fBflags\fR is a bitwise OR\&'d combination of the subsystems you wish to check (see \fI\fBSDL_Init\fP\fR for a list of subsystem flags)\&. |
slouken@0 | 12 |
.SH "RETURN VALUE" |
slouken@0 | 13 |
.PP |
slouken@0 | 14 |
\fBSDL_WasInit\fP returns a bitwised OR\&'d combination of the initialized subsystems\&. |
slouken@0 | 15 |
.SH "EXAMPLES" |
slouken@0 | 16 |
.PP |
slouken@0 | 17 |
.nf |
slouken@0 | 18 |
\f(CW |
slouken@0 | 19 |
/* Here are several ways you can use SDL_WasInit() */ |
slouken@0 | 20 |
|
slouken@0 | 21 |
/* Get init data on all the subsystems */ |
slouken@0 | 22 |
Uint32 subsystem_init; |
slouken@0 | 23 |
|
slouken@0 | 24 |
subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING); |
slouken@0 | 25 |
|
slouken@0 | 26 |
if(subsystem_init&SDL_INIT_VIDEO) |
slouken@0 | 27 |
printf("Video is initialized\&. |
slouken@0 | 28 |
"); |
slouken@0 | 29 |
else |
slouken@0 | 30 |
printf("Video is not initialized\&. |
slouken@0 | 31 |
"); |
slouken@0 | 32 |
|
slouken@0 | 33 |
|
slouken@0 | 34 |
|
slouken@0 | 35 |
/* Just check for one specfic subsystem */ |
slouken@0 | 36 |
|
slouken@0 | 37 |
if(SDL_WasInit(SDL_INIT_VIDEO)!=0) |
slouken@0 | 38 |
printf("Video is initialized\&. |
slouken@0 | 39 |
"); |
slouken@0 | 40 |
else |
slouken@0 | 41 |
printf("Video is not initialized\&. |
slouken@0 | 42 |
"); |
slouken@0 | 43 |
|
slouken@0 | 44 |
|
slouken@0 | 45 |
|
slouken@0 | 46 |
|
slouken@0 | 47 |
/* Check for two subsystems */ |
slouken@0 | 48 |
|
slouken@0 | 49 |
Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO; |
slouken@0 | 50 |
|
slouken@0 | 51 |
if(SDL_WasInit(subsystem_mask)==subsystem_mask) |
slouken@0 | 52 |
printf("Video and Audio initialized\&. |
slouken@0 | 53 |
"); |
slouken@0 | 54 |
else |
slouken@0 | 55 |
printf("Video and Audio not initialized\&. |
slouken@0 | 56 |
"); |
slouken@0 | 57 |
\fR |
slouken@0 | 58 |
.fi |
slouken@0 | 59 |
.PP |
slouken@0 | 60 |
.SH "SEE ALSO" |
slouken@0 | 61 |
.PP |
slouken@0 | 62 |
\fI\fBSDL_Init\fP\fR, \fI\fBSDL_Subsystem\fP\fR |
slouken@0 | 63 |
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03 |