Take the 2-minute tour ×

I need to write an application that (among the other things) renders 2D animated images, let's suppose it's a videogame.

Figured out that videogame-like images can have a quite complex structure that depends very little on the program logic, mostly on the image itself:

  • It can have several animations (one for each state the object to draw can be on)

  • To pass from a state to another there could be an acyclic animation too.

  • Each animation can be made of several frames, each of which has got a duration.

And also the way to store images on the disk can be complex:

  • The above properties of the image, of its states and of its frames should be stored on a data file bound to the image, not hardcoded in the program source.

  • The different frames could be put all together in the same image file, or on different layers of an image file, or on different image files.

  • Background pixels could be indicated via a separated bitmask or using a specific color.

And I guess actual videogames will need a lot more parameters which I don't (don't know, another bitmask to identify pixels to be replaced with team color or whatever).

This makes me think there must be already a library that does all of this. But half an hour on google didn't help me.

Is there any opensource 2D animation library for C++ or C?

Otherwise, if I need to write one, can you link any 2D animation library for other languages (or also closed source ones)? I'll be happy to give a loop to their API and to the way they work.

share|improve this question
add comment

3 Answers

up vote 6 down vote accepted

SDL is excellent for games. Check out http://www.sdltutorials.com/sdl-animation/

share|improve this answer
Probably more useful: the actual SDL website. SDL is LGPL'ed, written in C but with bindings for tons of other languages, and works on all common platforms. –  Jefromi Nov 16 '10 at 17:40
add comment

Here's a list of free graphics libraries.

share|improve this answer
I've edited your answer - it's best to describe what you link to instead of just saying "click here". (It's also often good to put some real content into your answer, not just the link.) –  Jefromi Nov 16 '10 at 17:29
add comment

If you are looking specifically for animation and target only Windows (Vista and later), be sure to check out Windows Animation Manager. Very powerful! http://msdn.microsoft.com/en-us/library/dd371981(v=VS.85).aspx

share|improve this answer
add comment

Your Answer


