#include<allegro5/allegro.h>
#include<allegro5/allegro_font.h>
#include<allegro5/allegro_ttf.h>
#include<allegro5/allegro_native_dialog.h>
int main() {
al_init();
ALLEGRO_DISPLAY *display;
display = al_create_display(640, 480);
al_init_font_addon;
al_init_ttf_addon;
ALLEGRO_FONT *font;
ALLEGRO_PATH * path = al_get_standard_path(ALLEGRO_RESOURCES_PATH);
al_set_path_filename(path, "Pacifico.ttf");
font = al_load_ttf_font(al_path_cstr(path, '/'), 20, 0);
if (font == NULL)
{
al_show_native_message_box(NULL, NULL, "Error", "Could not create Allegro 5 display", NULL, ALLEGRO_MESSAGEBOX_ERROR);
return -1;
}
al_clear_to_color(al_map_rgb(0, 0, 0));
al_draw_text(font, al_map_rgb(255, 0, 255), 50, 50, ALLEGRO_ALIGN_CENTRE, "Hello Gamers!");
al_flip_display();
al_rest(5.0);
al_destroy_display(display);
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.