#include <allegro.h>int main(void){ /* you should always do this at the start of Allegro programs */ if (allegro_init() != 0) return 1; /* set up the keyboard handler */ install_keyboard(); /* set a graphics mode sized 320x200 */ if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) { if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) { set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); allegro_message("Unable to set any graphic mode\n%s\n", allegro_error); return 1; } } /* set the color palette */ set_palette(desktop_palette); /* clear the screen to white */ clear_to_color(screen, makecol(255, 255, 255)); /* you don't need to do this, but on some platforms (eg. Windows) things * will be drawn more quickly if you always acquire the screen before * trying to draw onto it. */ acquire_screen(); /* write some text to the screen with black letters and transparent background */ textout_centre_ex(screen, font, "Hello, world!", SCREEN_W/2, SCREEN_H/2, makecol(0,0,0), -1); /* you must always release bitmaps before calling any input functions */ release_screen(); /* wait for a keypress */ readkey(); return 0;}END_OF_MAIN()
If you intend on getting a job and you tell them you work with Allegro and not Direct3D or OpenGL...Well, let's just say its good for starting, but it IS NOT a replacement for real libraries like DirectX and OpenGL.
SDL is being used as a game lib alot (in Linux Universe) due to the fact that has Sound Support (and some OpenGL support via X) and many other useful API.It's the same with allegro being used for other things beside game development. The best (read fun) thing is Allegro's SpeedHack.I don't think someone could SpeedHack with SDL (without using pygame). At least being faster in dev than Allegro.
I wouldn't compare Win32 with SDL.I just said that a huge amount of games in Linux are based on SDL, so someone can easily use it for game dev (see pygame) and of course compare it with allegro ( a clean fast graphics library). SDL can help you make a game very fast. Trying to do the same in Win32 is suicidal (even in DirectX could take a lot of time).Bottom Line : Allegro Rocks