1<HTML 2><HEAD 3><TITLE 4>SDL_WasInit</TITLE 5><META 6NAME="GENERATOR" 7CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ 8"><LINK 9REL="HOME" 10TITLE="SDL Library Documentation" 11HREF="index.html"><LINK 12REL="UP" 13TITLE="General" 14HREF="general.html"><LINK 15REL="PREVIOUS" 16TITLE="SDL_Quit" 17HREF="sdlquit.html"><LINK 18REL="NEXT" 19TITLE="SDL_GetError" 20HREF="sdlgeterror.html"></HEAD 21><BODY 22CLASS="REFENTRY" 23BGCOLOR="#FFF8DC" 24TEXT="#000000" 25LINK="#0000ee" 26VLINK="#551a8b" 27ALINK="#ff0000" 28><DIV 29CLASS="NAVHEADER" 30><TABLE 31SUMMARY="Header navigation table" 32WIDTH="100%" 33BORDER="0" 34CELLPADDING="0" 35CELLSPACING="0" 36><TR 37><TH 38COLSPAN="3" 39ALIGN="center" 40>SDL Library Documentation</TH 41></TR 42><TR 43><TD 44WIDTH="10%" 45ALIGN="left" 46VALIGN="bottom" 47><A 48HREF="sdlquit.html" 49ACCESSKEY="P" 50>Prev</A 51></TD 52><TD 53WIDTH="80%" 54ALIGN="center" 55VALIGN="bottom" 56></TD 57><TD 58WIDTH="10%" 59ALIGN="right" 60VALIGN="bottom" 61><A 62HREF="sdlgeterror.html" 63ACCESSKEY="N" 64>Next</A 65></TD 66></TR 67></TABLE 68><HR 69ALIGN="LEFT" 70WIDTH="100%"></DIV 71><H1 72><A 73NAME="SDLWASINIT" 74></A 75>SDL_WasInit</H1 76><DIV 77CLASS="REFNAMEDIV" 78><A 79NAME="AEN617" 80></A 81><H2 82>Name</H2 83>SDL_WasInit -- Check which subsystems are initialized</DIV 84><DIV 85CLASS="REFSYNOPSISDIV" 86><A 87NAME="AEN620" 88></A 89><H2 90>Synopsis</H2 91><DIV 92CLASS="FUNCSYNOPSIS" 93><A 94NAME="AEN621" 95></A 96><P 97></P 98><PRE 99CLASS="FUNCSYNOPSISINFO" 100>#include "SDL.h"</PRE 101><P 102><CODE 103><CODE 104CLASS="FUNCDEF" 105>Uint32 <B 106CLASS="FSFUNC" 107>SDL_WasInit</B 108></CODE 109>(Uint32 flags);</CODE 110></P 111><P 112></P 113></DIV 114></DIV 115><DIV 116CLASS="REFSECT1" 117><A 118NAME="AEN627" 119></A 120><H2 121>Description</H2 122><P 123><TT 124CLASS="FUNCTION" 125>SDL_WasInit</TT 126> allows you to see which SDL subsytems have been <A 127HREF="sdlinit.html" 128>initialized</A 129>. <TT 130CLASS="PARAMETER" 131><I 132>flags</I 133></TT 134> is a bitwise OR'd combination of the subsystems you wish to check (see <A 135HREF="sdlinit.html" 136><TT 137CLASS="FUNCTION" 138>SDL_Init</TT 139></A 140> for a list of subsystem flags).</P 141></DIV 142><DIV 143CLASS="REFSECT1" 144><A 145NAME="AEN635" 146></A 147><H2 148>Return Value</H2 149><P 150><TT 151CLASS="FUNCTION" 152>SDL_WasInit</TT 153> returns a bitwised OR'd combination of the initialized subsystems.</P 154></DIV 155><DIV 156CLASS="REFSECT1" 157><A 158NAME="AEN639" 159></A 160><H2 161>Examples</H2 162><PRE 163CLASS="PROGRAMLISTING" 164> /* Here are several ways you can use SDL_WasInit() */ 165 166/* Get init data on all the subsystems */ 167Uint32 subsystem_init; 168 169subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING); 170 171if(subsystem_init&SDL_INIT_VIDEO) 172 printf("Video is initialized.\n"); 173else 174 printf("Video is not initialized.\n"); 175 176 177 178/* Just check for one specfic subsystem */ 179 180if(SDL_WasInit(SDL_INIT_VIDEO)!=0) 181 printf("Video is initialized.\n"); 182else 183 printf("Video is not initialized.\n"); 184 185 186 187 188/* Check for two subsystems */ 189 190Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO; 191 192if(SDL_WasInit(subsystem_mask)==subsystem_mask) 193 printf("Video and Audio initialized.\n"); 194else 195 printf("Video and Audio not initialized.\n"); </PRE 196></DIV 197><DIV 198CLASS="REFSECT1" 199><A 200NAME="AEN642" 201></A 202><H2 203>See Also</H2 204><P 205><A 206HREF="sdlinit.html" 207><TT 208CLASS="FUNCTION" 209>SDL_Init</TT 210></A 211>, 212<A 213HREF="sdlinitsubsystem.html" 214><TT 215CLASS="FUNCTION" 216>SDL_Subsystem</TT 217></A 218></P 219></DIV 220><DIV 221CLASS="NAVFOOTER" 222><HR 223ALIGN="LEFT" 224WIDTH="100%"><TABLE 225SUMMARY="Footer navigation table" 226WIDTH="100%" 227BORDER="0" 228CELLPADDING="0" 229CELLSPACING="0" 230><TR 231><TD 232WIDTH="33%" 233ALIGN="left" 234VALIGN="top" 235><A 236HREF="sdlquit.html" 237ACCESSKEY="P" 238>Prev</A 239></TD 240><TD 241WIDTH="34%" 242ALIGN="center" 243VALIGN="top" 244><A 245HREF="index.html" 246ACCESSKEY="H" 247>Home</A 248></TD 249><TD 250WIDTH="33%" 251ALIGN="right" 252VALIGN="top" 253><A 254HREF="sdlgeterror.html" 255ACCESSKEY="N" 256>Next</A 257></TD 258></TR 259><TR 260><TD 261WIDTH="33%" 262ALIGN="left" 263VALIGN="top" 264>SDL_Quit</TD 265><TD 266WIDTH="34%" 267ALIGN="center" 268VALIGN="top" 269><A 270HREF="general.html" 271ACCESSKEY="U" 272>Up</A 273></TD 274><TD 275WIDTH="33%" 276ALIGN="right" 277VALIGN="top" 278>SDL_GetError</TD 279></TR 280></TABLE 281></DIV 282></BODY 283></HTML 284>