• News
  • Featured
  • For Beginners!
  • Games
  • Apps
  • C++ Libraries
  • SDL Libraries
  • Articles
  • Other Stuff
  • About
  • GigaSun Jet
  • Frank the Dinosaur
  • Fire, Fire, Where you are
  • Knight of the Cave Dragon
  • Treasure Tub
  • Slugs v Salt
  • Formula FUN!
  • Breakdown
  • MulpyPong
  • Bouquet Bowling
  • Func Generation
  • Pile
  • Soundout
  • Timeup
  • GoodIO
  • SpreadSheet Class
  • RandName
  • SPriG
  • NFont
  • MixBox
  • StickyInput
  • GRO_gui

SPriG

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.


SPriG has been used on many operating systems and devices and even has a couple of bindings to other languages (like Haskell).  If you like SPriG, check out the parallel page for NFont, an excellent bitmap font library (C/C++).

Features

Screenshots

Download

Using SPriG

Documentation

Improving SPriG


SPriG Features:

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.

Improving SPriG

If you'd like to get involved with making SPriG better, whether you have feature requests, suggestions, bug reports, or code to submit, check out the Google Code page:

SPriG on Google Code


  

Screenshots

Sprig Screenshot1 Sprig Screenshot2
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 Polygon Demo Sprig Dirty Rect Demo
Sprig on Nokia N770

Sprig on Nokia N770
(courtesy of Daniel "NeoStrider" Monteiro)





Development Notes 2-23-11:

Let me know what you think of Sprig! There's a new bugfix version coming soon (thickness was broken), but you can get it right away at the Google Code page.

If you have any requests, suggestions, or would like to contribute a binary package or Makefile for any specific OS, please send me an email!


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


v1.0.1 - 11/27/09

[Documentation (online)]
[Documentation (.zip)]

[Source]
[Binary - Win32]
[Binary - Linux]

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:

  Download the binary distribution for your operating system.
  Copy headers (sprig.h and sprig_inline.h) to your compiler's /include folder.
  Copy library files (libsprig.a, sprig.lib, or libsprig.so) to your compiler's /lib folder.
  Add library to your project's linked libraries (e.g. -lsprig).
  Include the header (#include "sprig.h").

Building from source using 'make':

  Download the source distribution.
  Unzip it and move into the src directory.
  Run 'make', then 'make install'.

Write a program and enjoy!

For a more detailed look at installing libraries, see Graphics from Scratch, Using SDL.
For more info on what SPriG can do, see A Guide to Graphics with SPriG.

 

BlueDinosaurs.com
Barrington, NH
Copyright 2009 - 2011