Advertisement
Sosowski

something I'm working on.

Aug 4th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var page1,page2,active_page;
  2. var tim=0;
  3.  
  4. function draw()
  5. {
  6.  
  7. }
  8.  
  9. function timer_proc()
  10. {
  11.  
  12. }
  13.  
  14. function timer()
  15. {
  16.     tim++;
  17. }
  18.  
  19. function main()
  20. {
  21.     allegro_init();
  22.     install_keyboard();
  23.     install_timer();
  24.     install_mouse();
  25.     install_sound();
  26.     set_gfx_mode("example", 640, 480);
  27.     page1 = create_bitmap(SCREEN_W, SCREEN_H);
  28.     page2 = create_bitmap(SCREEN_W, SCREEN_H);
  29.  
  30.     install_int_ex(timer, BPS_TO_TIMER(60));
  31.     active_page = page2;
  32.  
  33.     while(!key[KEY_ESC])
  34.     {
  35.       clear_to_color(active_page, makecol(255, 255, 255));
  36.  
  37.       while (tim >0)
  38.       {
  39.           timer_proc();
  40.           tim--;
  41.     }
  42.  
  43.       draw();
  44.  
  45.         blit(active_page,screen,0,0,0,0,SCREEN_W,SCREEN_H);
  46.  
  47.       if (active_page == page1)
  48.             active_page = page2;
  49.       else
  50.             active_page = page1;
  51.            
  52.    }
  53.  
  54.     return 0;
  55. }
  56. END_OF_MAIN();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement