views:

477

answers:

3

I am trying to write a 2d game engine in C (no c++). What are some good libraries that have generic data types I may need - for example queues, trees, maps, lists, and so on?

A: 

Not sure if this answer is what you're after, but a useful read on the subject is Sedgewick's "Algorithms in C"

HTH

dcw
+8  A: 

Take a look at GLib - it has trees, hashmaps, linked lists and queues.

EDIT: Wikipedia article.

qrdl
is glib cross platform?
kthakore
According to Wikipedia - yes, cross-platform, although platforms are not listed.
qrdl
this is a good idea. but glib has a lot of other things I don't need. Is there a slim version of glib thats only the data types.
kthakore
If it is static lib, only relevant object files will be linked with your binary. Anyway I guess you can roll your own version to include only object files you need.
qrdl
Fifted, if that's a word. glib for Win32 is a small handful of DLL:s, for the main components ("core", GObject, GIO, GModule, GThread). Total size is around 1.8 MB.
unwind
A: 

If you are on a mac you will have all of the basic data structures available to you in the core foundations framework.

Nick
I was looking for a more cross platform solution.
kthakore