Ciro_meneses

Allegro 4.4.2 test program

Nov 25th, 2015
1,621
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <allegro.h>
  2.  
  3. BITMAP *fundo, *buffer;
  4.  
  5. int main() {
  6.    allegro_init();
  7.   install_keyboard();
  8.  
  9. //Ajusta video para 16 bits de cores
  10.   set_color_depth(16);
  11.  
  12. //Autodetecta a placa  de video e usa resolucao de 640x480 em modo janela
  13.   set_gfx_mode(GFX_AUTODETECT_WINDOWED,640,480,640,480);
  14.  
  15.   buffer = create_bitmap(SCREEN_W,SCREEN_H);
  16.  
  17. //carrega o fundo
  18.   fundo = load_bitmap("img/f_castelo1.bmp",NULL);
  19.  
  20.   while(!key[KEY_ESC]) {
  21.  
  22.     triangle(screen, 400, 300, 450, 450, 480, 300, 1500);
  23.     circlefill(screen, 400, 100, 50, 900);
  24.     rectfill(screen, 300, 300, 50, 50, 25);
  25.     textprintf_ex(screen, font, 100, 22, makecol(255, 255, 0), -1,  "Allegro 4.4.2 OK!");
  26.     rest(100);
  27.  
  28.   }
  29.  
  30.  
  31.   allegro_exit();
  32.   return 0;
  33. }
  34. END_OF_MAIN()
RAW Paste Data