Advertisement
tourniquet

Allegro Draw Rectangle Lesson 3

Jan 29th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. // gcc -Wall 3.c -o 3 $(pkg-config --libs allegro-5.0 allegro_image-5.0 allegro_primitives-5.0)
  2. #include <allegro5/allegro.h>
  3. #include <allegro5/allegro_primitives.h>
  4.  
  5. int main(int argc, char **argv) {
  6.  
  7.     if(!al_init()) {
  8.         return -1;
  9.     }
  10.  
  11.     ALLEGRO_DISPLAY *display;
  12.     display = al_create_display(400, 400);
  13.  
  14.     if(!display) {
  15.         return -1;
  16.     }
  17.  
  18.     al_init_primitives_addon();
  19.  
  20.     al_clear_to_color(al_map_rgb(0, 0, 0));
  21.     al_draw_rectangle(10, 10, 200, 150, al_map_rgb(255, 0, 0), 0);
  22.  
  23.     al_flip_display();
  24.  
  25.     al_rest(60.0);
  26.     al_destroy_display(display);
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement