For 2D you could consider SDL at libsdl.org as suggested. For high level functions ontop of SDL there is SDLBASIC http://sdlbasic.sourceforge.net/flatnuke/ where you'll find a BASIC interpreter and the C functions as a separate engine.
Alternatively, there is Allegro at allegro.cc or alleg.sourceforge.net.