The SDL Primitive Generator, SPriG, is a free and open source C/C++ library that does three main things:
| * | Draws graphics primitives (pixels, lines, circles, polygons, etc.) with optional anti-aliasing, alpha-blending, and arbitrary thickness. |
| * | Rotates, scales, and mirrors SDL surfaces with optional anti-aliasing and alpha-blending. |
| * |
Makes working with SDL surfaces quicker and easier. |
Graphics primitives
Anti-aliased
primitives
Line thickness control
Built-in 'Dirty rect'
system
Shapes and polygons
Several alpha-blending
modes
Rotation
and scaling
Flood-fill
Palette functions
You can find a full list of functions here.
Unimplemented Features:
SPG_EllipseArb
SPG_TSLOW
SPG_TBLEND
SPG_TSURFACE_ALPHA
Known Bugs
The surface transform
functions have minor bugs like missing the bottom row of pixels.
Gouraud shading is direction-biased.
Alpha-blended beziers overdraw pixels.
Alpha-blending and anti-aliasing need special treatment in thick
primitives.
![]() |
![]() |
| A SPriG test program (excuse the scaling) | GigaSun Jet, a game using SPriG that is currently under development |
| Sprig Polygon Demo | Sprig Dirty Rect Demo |
![]() |
|
| Sprig on Nokia N770 (courtesy of Daniel "NeoStrider" Monteiro) |
| Name | Description | Dependencies | Version Info | License |
|
SPriG |
SPriG is a graphics primitive generator for SDL. It supplies a quick and simple interface for the drawing of primitives (pixels, lines, polygons), the rotation and zooming of surfaces, and many useful surface functions. It also includes several alpha-blending modes, dirty rectangles, and line thickness controls. |
SDL |
|
LGPL |
| SDL_gfx [Official Site] |
SDL_gfx is an active graphics extension for SDL that is very popular. | SDL | - | LGPL |
| SGE [Mirror of Official Site] |
SGE is a graphics library for SDL that provides the drawing of primitives, the rotation and zooming of surfaces, and much more. It is not in active development. | SDL FreeType (optional) SDL_image (optional) |
r030809 | LGPL |
Generic library installation guide: