1<HTML 2><HEAD 3><TITLE 4>General</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="SDL Reference" 14HREF="reference.html"><LINK 15REL="PREVIOUS" 16TITLE="SDL Reference" 17HREF="reference.html"><LINK 18REL="NEXT" 19TITLE="SDL_Init" 20HREF="sdlinit.html"><META 21NAME="KEYWORD" 22CONTENT="general"><META 23NAME="KEYWORD" 24CONTENT="function"></HEAD 25><BODY 26CLASS="CHAPTER" 27BGCOLOR="#FFF8DC" 28TEXT="#000000" 29LINK="#0000ee" 30VLINK="#551a8b" 31ALINK="#ff0000" 32><DIV 33CLASS="NAVHEADER" 34><TABLE 35SUMMARY="Header navigation table" 36WIDTH="100%" 37BORDER="0" 38CELLPADDING="0" 39CELLSPACING="0" 40><TR 41><TH 42COLSPAN="3" 43ALIGN="center" 44>SDL Library Documentation</TH 45></TR 46><TR 47><TD 48WIDTH="10%" 49ALIGN="left" 50VALIGN="bottom" 51><A 52HREF="reference.html" 53ACCESSKEY="P" 54>Prev</A 55></TD 56><TD 57WIDTH="80%" 58ALIGN="center" 59VALIGN="bottom" 60></TD 61><TD 62WIDTH="10%" 63ALIGN="right" 64VALIGN="bottom" 65><A 66HREF="sdlinit.html" 67ACCESSKEY="N" 68>Next</A 69></TD 70></TR 71></TABLE 72><HR 73ALIGN="LEFT" 74WIDTH="100%"></DIV 75><DIV 76CLASS="CHAPTER" 77><H1 78><A 79NAME="GENERAL" 80></A 81>Chapter 5. General</H1 82><DIV 83CLASS="TOC" 84><DL 85><DT 86><B 87>Table of Contents</B 88></DT 89><DT 90><A 91HREF="sdlinit.html" 92>SDL_Init</A 93> -- Initializes SDL</DT 94><DT 95><A 96HREF="sdlinitsubsystem.html" 97>SDL_InitSubSystem</A 98> -- Initialize subsystems</DT 99><DT 100><A 101HREF="sdlquitsubsystem.html" 102>SDL_QuitSubSystem</A 103> -- Shut down a subsystem</DT 104><DT 105><A 106HREF="sdlquit.html" 107>SDL_Quit</A 108> -- Shut down SDL</DT 109><DT 110><A 111HREF="sdlwasinit.html" 112>SDL_WasInit</A 113> -- Check which subsystems are initialized</DT 114><DT 115><A 116HREF="sdlgeterror.html" 117>SDL_GetError</A 118> -- Get SDL error string</DT 119><DT 120><A 121HREF="sdlenvvars.html" 122>SDL_envvars</A 123> -- SDL environment variables</DT 124></DL 125></DIV 126><P 127>Before SDL can be used in a program it must be initialized with <A 128HREF="sdlinit.html" 129><TT 130CLASS="FUNCTION" 131>SDL_Init</TT 132></A 133>. <TT 134CLASS="FUNCTION" 135>SDL_Init</TT 136> initializes all the subsystems that the user requests (video, audio, joystick, timers and/or cdrom). Once SDL is initialized with <TT 137CLASS="FUNCTION" 138>SDL_Init</TT 139> subsystems can be shut down and initialized as needed using <A 140HREF="sdlinitsubsystem.html" 141><TT 142CLASS="FUNCTION" 143>SDL_InitSubSystem</TT 144></A 145> and <A 146HREF="sdlquitsubsystem.html" 147><TT 148CLASS="FUNCTION" 149>SDL_QuitSubSystem</TT 150></A 151>.</P 152><P 153>SDL must also be shut down before the program exits to make sure it cleans up correctly. Calling <A 154HREF="sdlquit.html" 155><TT 156CLASS="FUNCTION" 157>SDL_Quit</TT 158></A 159> shuts down all subsystems and frees any resources allocated to SDL.</P 160></DIV 161><DIV 162CLASS="NAVFOOTER" 163><HR 164ALIGN="LEFT" 165WIDTH="100%"><TABLE 166SUMMARY="Footer navigation table" 167WIDTH="100%" 168BORDER="0" 169CELLPADDING="0" 170CELLSPACING="0" 171><TR 172><TD 173WIDTH="33%" 174ALIGN="left" 175VALIGN="top" 176><A 177HREF="reference.html" 178ACCESSKEY="P" 179>Prev</A 180></TD 181><TD 182WIDTH="34%" 183ALIGN="center" 184VALIGN="top" 185><A 186HREF="index.html" 187ACCESSKEY="H" 188>Home</A 189></TD 190><TD 191WIDTH="33%" 192ALIGN="right" 193VALIGN="top" 194><A 195HREF="sdlinit.html" 196ACCESSKEY="N" 197>Next</A 198></TD 199></TR 200><TR 201><TD 202WIDTH="33%" 203ALIGN="left" 204VALIGN="top" 205>SDL Reference</TD 206><TD 207WIDTH="34%" 208ALIGN="center" 209VALIGN="top" 210><A 211HREF="reference.html" 212ACCESSKEY="U" 213>Up</A 214></TD 215><TD 216WIDTH="33%" 217ALIGN="right" 218VALIGN="top" 219>SDL_Init</TD 220></TR 221></TABLE 222></DIV 223></BODY 224></HTML 225>