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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#include <allegro5\allegro.h>
#include <allegro5\allegro_native_dialog.h>
#include <allegro5\allegro_font.h>
#include <allegro5\allegro_ttf.h>
int main ()
{
ALLEGRO_DISPLAY *display =NULL;
if (!al_init())
{
al_show_native_message_box (NULL, NULL, NULL,
"FAILED TO INITIALIZE ALLEGRO", NULL, NULL);
return -1;
}
display = al_create_display (640, 480);
if (!display)
{
al_show_native_message_box (NULL, NULL, NULL,
"FAILED TO INITIALIZE display", NULL, NULL);
return -1;
}
al_init_font_addon();
al_init_ttf_addon();
ALLEGRO_FONT *font24 = al_load_font ("arial.ttf", 24, 0);
al_clear_to_color (al_map_rgb (0,0,0));
al_draw_text (font24, al_map_rgb(255,0,255), 50, 50, 0, "Hello World, this is Allegro the magical game library!");
al_flip_display;
al_rest (3.0);
al_destroy_display(display);
return 0;
}
|