render.h File Reference

The header file for a fairly optimized 2D rendering system built on SDL. More...

#include <SDL.h>
#include "bool.h"

Include dependency graph for render.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DisplayInfo_t
 Contains globally accessible information about the display. More...
struct  Layer_t
 Describes a layer for rendering. More...
struct  RenderItem_t
 The fundamental unit for a visible rectangular region. More...


#define BACK_STATES   2
 The number of previous rendered states stored.
#define ClipRectToRect(clip, limit)
 Clips a rectangle to fit within the given bounding rectangle.
#define ClipRectToWH(clip, width, height)
 Clips a rectangle to fit within a physical region defined by a width and a height.
 Evaluates to the fastest (hopefully) type of surface, hardware or software, at runtime.
#define MAX_LAYERS   6
 The total number of layers that will be available for rendering.


typedef void(*) ItemRenderer (SDL_Surface *dest, RenderItem *item)
 A function pointer type that references a function called upon to render an item.
typedef Layer_t Layer
typedef RenderItem_t RenderItem


void AddRenderItem (RenderItem *item, int layer)
 Adds a new RenderItem to the world list of a Layer.
void ClearRenderItem (RenderItem *item)
 Makes an item no longer visible until the next PlaceRenderItem() call on the item.
void ForceDirtyFrame ()
 Set the dirty flag to force the renderer to perform a partial redraw for the next frame.
void ForceRenderAll ()
 Force everything to be redrwan for the next frame.
void GenericSurfaceRenderer (SDL_Surface *dest, RenderItem *item)
 Renders a surface pointed to by item->data.
void PlaceRenderItem (RenderItem *item)
 Places a render item on the physical display based on information set within the item.
void RemoveRenderItem (RenderItem *item)
 Removes a RenderItem from a Layer.
void Render ()
 Renders a frame.
void RenderClearStates (Uint8 numStates)
 Clears all display state information and optionally changes the number of states to use.
Bool RenderInit (Uint16 numRects, Uint8 numStates)
 Initalizes the rendering system.
void RenderUninit ()
 Uninitializes the rendering system.
Bool RenderWillRenderAll ()
 Tells if the next call to Render() will render an entire frame rather than just a changed portion.
Bool ResizeWindow (Uint16 w, Uint16 h)
 A utility function for resizing the program's window.
void SetLayerOffset (Layer *layer, Sint16 x, Sint16 y)
 Changes the layer's offset from the physical display.
void SolidFillRenderer (SDL_Surface *dest, RenderItem *item)
 Renders a solid rectangle who's color is stored at item->data.


DisplayInfo_t dInfo
 Global information about the display.
Layer layers [6]
 The global set of Layers.

Detailed Description

The header file for a fairly optimized 2D rendering system built on SDL.

Jeff Jackowski (
Copyright (C) 2007 Jeff Jackowski

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Or visit their website at:

Definition in file render.h.

Generated on Mon May 28 04:41:40 2007 for Retro Tank Super Attack by  doxygen 1.5.2