Advertisement
Sosowski

Untitled

Aug 4th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var page1,page2,active_page,logo;
  2. var tim=0;
  3.  
  4. function draw()
  5. {
  6.     stretch_blit(logo,active_page,0,0,logo.w,logo.h,0,0,SCREEN_W,SCREEN_H);
  7. }
  8.  
  9. function update()
  10. {
  11.  
  12. }
  13.  
  14. function main()
  15. {
  16.     allegro_init();
  17.     set_gfx_mode("example", 640, 480);
  18.     install_keyboard();
  19.     install_timer();
  20.     install_mouse();
  21.     install_sound();
  22.     page1 = create_bitmap(SCREEN_W, SCREEN_H);
  23.     page2 = create_bitmap(SCREEN_W, SCREEN_H);
  24.     logo = load_bmp("allegro.png");
  25.    
  26.     active_page = page2;
  27.  
  28.     install_int_ex(function()
  29.     {
  30.       clear_to_color(active_page, makecol(255, 255, 255));
  31.  
  32.         update();
  33.  
  34.       draw();
  35.  
  36.         blit(active_page,canvas,0,0,0,0,SCREEN_W,SCREEN_H);
  37.  
  38.       if (active_page == page1)
  39.             active_page = page2;
  40.       else
  41.             active_page = page1;
  42.            
  43.    }, BPS_TO_TIMER(60));
  44.  
  45.     return 0;
  46. }
  47. END_OF_MAIN();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement