Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Programmer:
- // Project: Untitled
- // Date Created: 2/17/2012
- // Last edited: 2/18/2012
- // Function prototypes
- // Libraries
- #include <stdlib.h>
- #include <stdio.h>
- #include <math.h>
- #include <string.h>
- // Allegro libraries
- #include <allegro5\allegro.h>
- #include <allegro5\allegro_font.h>
- #include <allegro5\allegro_ttf.h>
- // Constants
- // Main Function
- int main (void)
- {
- // Initialize display
- ALLEGRO_DISPLAY *display = NULL;
- // Check if Allegro intitialized
- if (!al_init())
- {
- fprintf (stderr, "Failed to initialize Allegro!\n");
- return -1;
- }
- // Create display
- display = al_create_display(640, 480);
- // Check if display initialized
- if (!display)
- {
- fprintf (stderr, "Failed to create display!\n");
- return -1;
- }
- // Initialize font/ttf addons
- al_init_font_addon ();
- al_init_ttf_addon ();
- // Load in font
- ALLEGRO_FONT *font24 = al_load_font ("BAUHS93.ttf", 24, 0);
- // Clear screen color
- al_clear_to_color (al_map_rgb (0, 0, 0));
- // Draw to screen
- al_draw_text (font24, al_map_rgb (255, 120, 20), 50, 50, 0, "Why hello there, hopefully this all works out.");
- // Switch buffers
- al_flip_display ();
- // Rest screen
- al_rest (5.0);
- // Destroy display
- al_destroy_display (display);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement