[nSLUG] Graphics library?

Eric R. Smith ersmith at hfx.eastlink.ca
Wed Feb 14 12:25:10 AST 2007


Mike wrote:
> I want to do some animations of mechanical devices -- rotating parts,
> connecting rods, springs etc.  Doesn't need to be even vaguely
> realistic.  Looking around for a graphics C library that will be easy
> to use.  The options seem to be:
> 
>      svgalib:  
...
>      X
...
>      GGI
...
>Is there anything else?  What have you used?  Any suggestions?  Is
> there even a *commercial* package for Linux that does this? (Of
> course, I'm not interested in video rendering packages at $K and up.)
> 

OpenGL may be a good choice for you. It's most known for 3D rendering, 
but of course 2D rendering is a subset of this (and OpenGL does have a 
few 2D specific features, like bitmaps). Some version of OpenGL should 
come with most distros. There's a utility library (GLUT) that handles a 
lot of the bookkeeping for you, and plenty of tutorials around on the 
web. The NeHe Productions page (http://nehe.gamedev.net) has some nice ones.

For low level banging on the hardware (at about the level of svgalib, X, 
or GGI, but with a simpler API) I like SDL. The graphics portions of SDL 
is a thin layer on top of one of those other libararies (you get to 
pick). It provides a nice cross platform abstraction for graphics and 
input. But it doesn't have many primitives either; you'll either need an 
add-on library (there are some around) or use OpenGL along with SDL.

Eric

!DSPAM:45d5e4af24703820916638!




More information about the nSLUG mailing list