1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <allegro.h>
int main (void)
{
char *filename = "gradient.BMP";
BITMAP *image;
int ret;
allegro_init();
install_keyboard();
set_color_depth(16);
ret = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
if (ret != 0){
allegro_message(allegro_error);
return 1;
}
image = load_bitmap(filename, NULL);
if (!image){
allegro_message("Error loading %s", filename);
return 1;
}
blit(image, screen, 0,0,0,0, SCREEN_W, SCREEN_H);
destroy_bitmap(image);
textprintf_ex(screen, font, 0, 0, 1, -1, "%dx%d", SCREEN_W, SCREEN_H);
while(!keypressed());
allegro_exit();
return 0;
}
END_OF_MAIN()
|