\chapter{Glossary of Terms}

\begin{bodylist}

\index{alpha blending}
\item [alpha blending] An operation that combines two pixel values together so as to simulate a certain degree of transparency. This is done on a per-pixel basis with an additional piece of data called an alpha value that represents each pixel's translucency. \emph{Page~\pageref{sect:sdlalphablending}.}

\index{animation}
\item [animation] The art of fooling the human eye into perceiving motion. \emph{Chapter~\ref{ch:masteringsdl}.}

\index{artifact}
\item [artifact] A (usually minor) audio or display glitch, often caused by an unexpected situation, insufficient performance, or a heavy system load. Some common artifacts are \firstterm{shearing} and flicker. Artifacts are bad.

\index{blitting}
\item [blit] A fast copy between two pieces of graphics data. Blitting is one of the most basic operations in 2D computer graphics. The word itself comes from \emph{bl}ock \emph{i}mage \emph{t}ransfer. \emph{Page~\pageref{sect:sdlblitting}.}

\index{colormap}
\item [colormap] \emph{See \firstterm{palette}.}

\index{direct color (display mode)}
\item [direct color] Somewhat uncommon but powerful display mode in which each pixel value is divided into three bitfields, each of which indexes a separate table. The values retrieved from these tables are used as the red, green, and blue components for the pixel. Direct color is essentially a powerful hybrid of \firstterm{indexed} and \firstterm{true color} modes. \emph{Page~\pageref{displaymodes}.}

\index{double buffering}
\item[double buffering] Technique of drawing the next frame of animation in an off-screen buffer and \firstterm{blitting} it quickly to the screen at the appropriate time. This reduces the possibility of various display \firstterm{artifacts} by confining all actual display updates to a very short and carefully timed interval. \emph{Page~\pageref{sdldoublebuf}.}

\index{engine}
\item [engine] The core of a game. A game engine coordinates input processing, graphics, audio, networking, and game rules to present the player with an interesting experience. Engines are frequently licensed between game companies to speed up game development. For instance, id Software has licensed derivatives of its Quake engine to several other game development studios. \emph{Page~\pageref{sect:engineoverview}.}

\index{genres!first-person shooters}
\item [first-person shooter (FPS)] A game genre in which the player controls a character from a first person perspective (that is, through the character's eyes). Examples are the id's \gametitle{Quake} series, Activision's \gametitle{Soldier of Fortune}, and Valve's \gametitle{Half-Life}. \emph{Page~\pageref{sect:fps}.}

\index{framebuffer}
\item [framebuffer] Block of memory that represents the data on the screen. A framebuffer usually contains one or two bytes of information for each \firstterm{pixel} on the screen. \emph{Page~\pageref{framebuffer}.}

\index{hicolor (display mode)}
\item [hicolor] Also known as high color. Family of 16-bit \firstterm{RGB} display modes with five or six bits for each color component. \emph{Page~\pageref{displaymodes}.}

\index{indexed (display mode)}
\item [indexed display mode] Display mode in which each pixel value is interpreted as an index into a table (\firstterm{palette}) of predefined red, green, and blue values. \emph{Page~\pageref{displaymodes}.} 

\index{latency}
\item [latency] In computer audio playback, the amount of time it takes a newly played sample to actually reach the speakers. This should only be a small fraction of a second. Network sound mixers like ESD and (to a lesser degree) aRts are known to produce high latency. \emph{Pages~\pageref{osslatency},~\pageref{esdlatency}.}

\index{mutex}
\item [mutex] Mutual exclusion lock. Used in multithreaded programming to keep two threads from trying to modify the same piece of data at once. \emph{Page~\pageref{mutex}.}

\index{packed pixel (display mode)}
\item [packed pixel] Synonymous with \firstterm{hicolor} or \firstterm{true color}. The term refers to the fact that the color components of each pixel are packed into bitfields. \emph{Page~\pageref{displaymodes}.}

\index{page flipping}
\item [page flipping] Hardware-accelerated version of \firstterm{double buffering}. In this case the offscreen buffer and \firstterm{framebuffer} are identical and can be switched (``flipped'') at any time by updating a graphics card register. This obviates the need for blitting. \index{SDL!page flipping}SDL tries to use hardware page flipping if both \code{SDL\_HWSURFACE} and \code{SDL\_DOUBLEBUF} are specified when the video mode is set. (Use the \codei{SDL\_Flip} function to perform the page flip each frame.)

\index{palette}
\item [palette] Used in \firstterm{indexed} video modes to specify the red, green, and blue components of each possible color value. A palette is simply a table of RGB values, usually stored in graphics card registers. \emph{Page~\pageref{displaymodes}.}

\index{particle systems}
\item [particle system] A group of individual, tiny objects, each with a position and path of motion. Particle systems can be used to simulate anything from flying debris to vehicle exhaust. \emph{Page~\pageref{sect:pwparticle}.}

\index{PCM}
\item [PCM] Pulse-coded modulation. The most common way of storing and playing digital audio samples. Each PCM sample represents the amplitude of the sound wave at a given instant. \emph{Page~\pageref{sect:pcmsound}.}

\index{pixels}
\item [pixel] One blotch of color on the screen. Pixels are arranged in a precise grid on the screen, and their colors are updated between 50 and 100 times each second. Each pixel has a distinct color, usually specified in terms of its red, green, and blue components, and this color data is stored in memory accessible to the computer's graphics hardware. Less commonly known as \firstterm{pels}. The name comes from \emph{pi}ctorial \emph{el}ement. \emph{Page~\pageref{pixels}.}

\index{genres!real-time strategy}
\item [real-time strategy (RTS)] A game genre in which the player controls a group of characters in some sort of conquest or battle, usually from an overhead view. Examples are Westwood Studios' \gametitle{Command and Conquer} series and Blizzard Entertainment's \gametitle{StarCraft}. \emph{Page~\pageref{sect:rts}.}

\index{RGB (display mode)}
\item [RGB display mode] Display mode in which each pixel value is directly expressed in terms of its red, green, and blue intensities. Each component is usually specified with five to eight bits, depending on the particular mode. Two popular RGB formats are \firstterm{hicolor} and \firstterm{true color}. \emph{Page~\pageref{displaymodes}.}

\index{samples}
\item [sample] A single piece of audio data. Analogous to a pixel. A computer sound clip consists of thousands of samples taken at regular time intervals. \emph{See~also~\firstterm{PCM}.}

\index{shearing}
\item [shearing] A common display \firstterm{artifact} that occurs when a program tries to draw on the screen \emph{while} the video controller is refreshing the screen. The result is that an image is only partially drawn on the screen for a split second. This isn't disastrous and often goes unnoticed, but it can become distracting.

\index{surface}
\index{SDL!surfaces}
\item [surface] In SDL, a structure that represents a piece of graphics data. DirectX calls them buffers. \emph{Page~\pageref{sect:sdlsurfaces}.}

\index{triple buffering}
\item [triple buffering] Technique similar to \firstterm{double buffering} that uses two off-screen surfaces instead of one (three surfaces total). Triple buffering can be useful for taking advantage of graphics acceleration. Some video adapters are capable of copying data in the background, and triple buffering allows a program to draw to a third buffer while the video hardware is busy swapping the other two.

\index{true color (display mode)}
\item [true color] 24-bit \firstterm{RGB} display mode with 8 bits for each color component. \emph{Page~\pageref{displaymodes}}.

\index{genres!turn-based strategy}
\item [turn-based strategy (TBS)] A game genre similar in some ways to the \firstterm{real-time strategy} genre, except that the game is divided into distinct turns, often with no time limit imposed. At the risk of generalizing, TBS games involve more thought and careful planning, while \firstterm{RTS} games require quick thinking. Examples are the \gametitle{Civilization} series and \gametitle{Sid Meier's Alpha Centauri} (\gametitle{SMAC}). \emph{Page~\pageref{sect:tbs}.}

\index{voxels}
\item [voxel] Short for Volumetric Pixel. Voxels are used to create fast but detailed renderings of complex objects. The most familiar use of voxels is terrain rendering, but the technique has also been applied in many other situations (for example, character rendering in \gametitle{Sid Meier's Alpha Centauri}, based on the Caviar animation library). Voxels are essentially pixels in three-dimensional space, and entire scenes of voxels can be rendered extremely quickly if some limits are placed on the scene's geometry.

\end{bodylist}
