Guest User

Untitled

a guest
May 27th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <allegro.h>
  2.  
  3. void init();
  4. void deinit();
  5.  
  6. int main() {
  7. init();
  8. int r = 10;
  9. int x =0, y=0;
  10.  
  11. while (!key[KEY_ESC]) {
  12. circlefill(screen, x, y, r, makecol(255, 160 ,0));
  13. r += 1;
  14. x += 1;
  15. y +=1 ;
  16. _sleep(100);
  17. }
  18.  
  19. deinit();
  20. return 0;
  21. }
  22. END_OF_MAIN()
  23.  
  24. void init() {
  25. int depth, res;
  26. allegro_init();
  27. depth = desktop_color_depth();
  28. if (depth == 0) depth = 32;
  29. set_color_depth(depth);
  30. res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
  31. if (res != 0) {
  32. allegro_message(allegro_error);
  33. exit(-1);
  34. }
  35.  
  36. install_timer();
  37. install_keyboard();
  38. install_mouse();
  39. /* add other initializations here */
  40. }
  41.  
  42. void deinit() {
  43. clear_keybuf();
  44. /* add other deinitializations here */
  45. }
Add Comment
Please, Sign In to add comment