Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var page1,page2,active_page;
- var tim=0;
- function draw()
- {
- }
- function timer_proc()
- {
- }
- function timer()
- {
- tim++;
- }
- function main()
- {
- allegro_init();
- install_keyboard();
- install_timer();
- install_mouse();
- install_sound();
- set_gfx_mode("example", 640, 480);
- page1 = create_bitmap(SCREEN_W, SCREEN_H);
- page2 = create_bitmap(SCREEN_W, SCREEN_H);
- install_int_ex(timer, BPS_TO_TIMER(60));
- active_page = page2;
- while(!key[KEY_ESC])
- {
- clear_to_color(active_page, makecol(255, 255, 255));
- while (tim >0)
- {
- timer_proc();
- tim--;
- }
- draw();
- blit(active_page,screen,0,0,0,0,SCREEN_W,SCREEN_H);
- if (active_page == page1)
- active_page = page2;
- else
- active_page = page1;
- }
- return 0;
- }
- END_OF_MAIN();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement