You need to do the following things to enable transparent pixels:
Call set_color_depth(32)
before calling set_gfx_mode()
Load your images after calling set_gfx_mode()
Use masked_blit()
or draw_sprite()
to draw the image.
If you do the above, all "magic pink" pixels (100% red, 0% green, 100% blue) will be treated as transparent.
BITMAP *bmp;
allegro_init();
set_color_depth(32);
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
clear_to_color(screen, makecol(0,0,0));
// once the video mode has been set, it is safe to create/load images.
// this bitmap will be 640x480 with pure pink.
bmp = create_bitmap(640, 480);
clear_to_color(bmp, makecol(255,0,255));
rectfill(bmp, 100,100, 200,200, makecol(255,255,255));
draw_sprite(screen, bmp, 0, 0);
// or
// masked_blit(bmp, screen, 0,0, 0,0, 640,480);