1<HTML 2><HEAD 3><TITLE 4>SDL_Init</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="General" 17HREF="general.html"><LINK 18REL="NEXT" 19TITLE="SDL_InitSubSystem" 20HREF="sdlinitsubsystem.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="general.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="sdlinitsubsystem.html" 63ACCESSKEY="N" 64>Next</A 65></TD 66></TR 67></TABLE 68><HR 69ALIGN="LEFT" 70WIDTH="100%"></DIV 71><H1 72><A 73NAME="SDLINIT" 74></A 75>SDL_Init</H1 76><DIV 77CLASS="REFNAMEDIV" 78><A 79NAME="AEN440" 80></A 81><H2 82>Name</H2 83>SDL_Init -- Initializes SDL</DIV 84><DIV 85CLASS="REFSYNOPSISDIV" 86><A 87NAME="AEN443" 88></A 89><H2 90>Synopsis</H2 91><DIV 92CLASS="FUNCSYNOPSIS" 93><A 94NAME="AEN444" 95></A 96><P 97></P 98><PRE 99CLASS="FUNCSYNOPSISINFO" 100>#include "SDL.h"</PRE 101><P 102><CODE 103><CODE 104CLASS="FUNCDEF" 105>int <B 106CLASS="FSFUNC" 107>SDL_Init</B 108></CODE 109>(Uint32 flags);</CODE 110></P 111><P 112></P 113></DIV 114></DIV 115><DIV 116CLASS="REFSECT1" 117><A 118NAME="AEN450" 119></A 120><H2 121>Description</H2 122><P 123>Initializes SDL. This should be called before all other SDL functions. The <TT 124CLASS="PARAMETER" 125><I 126>flags</I 127></TT 128> parameter specifies what part(s) of SDL to initialize.</P 129><DIV 130CLASS="INFORMALTABLE" 131><A 132NAME="AEN454" 133></A 134><P 135></P 136><TABLE 137BORDER="1" 138CLASS="CALSTABLE" 139><TBODY 140><TR 141><TD 142ALIGN="LEFT" 143VALIGN="TOP" 144><TT 145CLASS="LITERAL" 146>SDL_INIT_TIMER</TT 147></TD 148><TD 149ALIGN="LEFT" 150VALIGN="TOP" 151>Initializes the <A 152HREF="time.html" 153>timer</A 154> subsystem.</TD 155></TR 156><TR 157><TD 158ALIGN="LEFT" 159VALIGN="TOP" 160><TT 161CLASS="LITERAL" 162>SDL_INIT_AUDIO</TT 163></TD 164><TD 165ALIGN="LEFT" 166VALIGN="TOP" 167>Initializes the <A 168HREF="audio.html" 169>audio</A 170> subsystem.</TD 171></TR 172><TR 173><TD 174ALIGN="LEFT" 175VALIGN="TOP" 176><TT 177CLASS="LITERAL" 178>SDL_INIT_VIDEO</TT 179></TD 180><TD 181ALIGN="LEFT" 182VALIGN="TOP" 183>Initializes the <A 184HREF="video.html" 185>video</A 186> subsystem.</TD 187></TR 188><TR 189><TD 190ALIGN="LEFT" 191VALIGN="TOP" 192><TT 193CLASS="LITERAL" 194>SDL_INIT_CDROM</TT 195></TD 196><TD 197ALIGN="LEFT" 198VALIGN="TOP" 199>Initializes the <A 200HREF="cdrom.html" 201>cdrom</A 202> subsystem.</TD 203></TR 204><TR 205><TD 206ALIGN="LEFT" 207VALIGN="TOP" 208><TT 209CLASS="LITERAL" 210>SDL_INIT_JOYSTICK</TT 211></TD 212><TD 213ALIGN="LEFT" 214VALIGN="TOP" 215>Initializes the <A 216HREF="joystick.html" 217>joystick</A 218> subsystem.</TD 219></TR 220><TR 221><TD 222ALIGN="LEFT" 223VALIGN="TOP" 224><TT 225CLASS="LITERAL" 226>SDL_INIT_EVERYTHING</TT 227></TD 228><TD 229ALIGN="LEFT" 230VALIGN="TOP" 231>Initialize all of the above.</TD 232></TR 233><TR 234><TD 235ALIGN="LEFT" 236VALIGN="TOP" 237><TT 238CLASS="LITERAL" 239>SDL_INIT_NOPARACHUTE</TT 240></TD 241><TD 242ALIGN="LEFT" 243VALIGN="TOP" 244>Prevents SDL from catching fatal signals.</TD 245></TR 246><TR 247><TD 248ALIGN="LEFT" 249VALIGN="TOP" 250><TT 251CLASS="LITERAL" 252>SDL_INIT_EVENTTHREAD</TT 253></TD 254><TD 255ALIGN="LEFT" 256VALIGN="TOP" 257> </TD 258></TR 259></TBODY 260></TABLE 261><P 262></P 263></DIV 264></DIV 265><DIV 266CLASS="REFSECT1" 267><A 268NAME="AEN494" 269></A 270><H2 271>Return Value</H2 272><P 273>Returns <SPAN 274CLASS="RETURNVALUE" 275>-1</SPAN 276> on an error or <SPAN 277CLASS="RETURNVALUE" 278>0</SPAN 279> on success.</P 280></DIV 281><DIV 282CLASS="REFSECT1" 283><A 284NAME="AEN499" 285></A 286><H2 287>See Also</H2 288><P 289><A 290HREF="sdlquit.html" 291><TT 292CLASS="FUNCTION" 293>SDL_Quit</TT 294></A 295>, 296<A 297HREF="sdlinitsubsystem.html" 298><TT 299CLASS="FUNCTION" 300>SDL_InitSubSystem</TT 301></A 302></P 303></DIV 304><DIV 305CLASS="NAVFOOTER" 306><HR 307ALIGN="LEFT" 308WIDTH="100%"><TABLE 309SUMMARY="Footer navigation table" 310WIDTH="100%" 311BORDER="0" 312CELLPADDING="0" 313CELLSPACING="0" 314><TR 315><TD 316WIDTH="33%" 317ALIGN="left" 318VALIGN="top" 319><A 320HREF="general.html" 321ACCESSKEY="P" 322>Prev</A 323></TD 324><TD 325WIDTH="34%" 326ALIGN="center" 327VALIGN="top" 328><A 329HREF="index.html" 330ACCESSKEY="H" 331>Home</A 332></TD 333><TD 334WIDTH="33%" 335ALIGN="right" 336VALIGN="top" 337><A 338HREF="sdlinitsubsystem.html" 339ACCESSKEY="N" 340>Next</A 341></TD 342></TR 343><TR 344><TD 345WIDTH="33%" 346ALIGN="left" 347VALIGN="top" 348>General</TD 349><TD 350WIDTH="34%" 351ALIGN="center" 352VALIGN="top" 353><A 354HREF="general.html" 355ACCESSKEY="U" 356>Up</A 357></TD 358><TD 359WIDTH="33%" 360ALIGN="right" 361VALIGN="top" 362>SDL_InitSubSystem</TD 363></TR 364></TABLE 365></DIV 366></BODY 367></HTML 368>