home *** CD-ROM | disk | FTP | other *** search
/ Game Programming - All in One (3rd Edition) / game_prog_all_in_one_3rd_ed.iso / sources / chapter08 / flipsprite / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-13  |  872 b   |  35 lines

  1. ////////////////////////////////////////////////////////////////
  2. // Game Programming All In One, Third Edition
  3. // Chapter 8 - FlipSprite
  4. ////////////////////////////////////////////////////////////////
  5.  
  6. #include <allegro.h>
  7.  
  8. int main()
  9. {
  10.     BITMAP *panel;
  11.  
  12.     //initialize the program
  13.     allegro_init();
  14.     install_keyboard();
  15.     set_color_depth(16);
  16.     set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
  17.  
  18.     //load the dragon bitmap
  19.     panel = load_bitmap("panel.bmp", NULL);
  20.  
  21.     //draw the sprite
  22.     draw_sprite(screen, panel, 200, 100);
  23.     draw_sprite_h_flip(screen, panel, 200+128, 100);
  24.     draw_sprite_v_flip(screen, panel, 200, 100+128);
  25.     draw_sprite_vh_flip(screen, panel, 200+128, 100+128);
  26.  
  27.     //delete the bitmap
  28.     destroy_bitmap(panel);
  29.  
  30.     while(!keypressed());
  31.     allegro_exit();
  32.     return 0;
  33. }
  34. END_OF_MAIN()
  35.