I have used SDL 1.2 on the Raspberry Pi with Raspbian, by installing the libsdl1.2-dev
package that lenik suggests. It also works from the console, so X is not needed.
The only special thing with running from the console on the Raspberry Pi, is that you have to check the supported screen size and then initialize your screen with wathever values you get. See Gordon's post on this. Another thing to note there is that the Raspberry Pi (at least by default?) uses 16 bit/pixel colors, so use 16 bit/pixel throughout the program for the best performance. Also see the thread Idiot's guide to C++/SDL Setup in the Raspberry Pi forum.
I do roughly this in a platform game I am working on, mostly from the forum thread:
SDL_Surface * makeWindow()
{
SDL_Surface *screen;
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0)
dieSDL("SDL init failed: %s\n");
const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo ();
int systemX = videoInfo->current_w;
int systemY = videoInfo->current_h;
int systemZ = videoInfo->vfmt->BitsPerPixel;
printf ("%d x %d, %d bpp\n", systemX, systemY, systemZ);
screen = SDL_SetVideoMode(systemX, systemY, systemZ,
SDL_SWSURFACE); // | SDL_FULLSCREEN);
if (screen == NULL)
dieSDL("SDL_SetVideoMode failed: %s\n");
return screen;
}
The game is here, but there isn't any Raspberry Pi version published yet.