Mail Archives: djgpp/1998/11/18/08:19:14
add the following line to your program (marked with *****)
>#include <stdlib.h>
>#include <stdio.h>
>#include "allegro.h"
>
>BITMAP *back, *map; // load the back picture
>BITMAP *vback; // virtual screen
>
>void close();
>void init();
>
>void close()
>{
> destroy_bitmap(vback);
> destroy_bitmap(back);
> destroy_bitmap(map);
>}
>
>void init()
>{
> allegro_init();
> install_timer();
> install_keyboard();
> install_mouse();
>
> set_color_depth(24);
> set_gfx_mode(GFX_AUTODETECT,640,480,0,0);
>
> position_mouse(319,239); // set the mouse position on screen
> set_mouse_range(0,0,639,479); // set the mouse range on screen
>
> vback = create_bitmap(640,480);
> clear(vback);
> map = create_bitmap(192,480);
> clear(map);
>
> map = load_pcx("back_1.pcx",NULL);
> back= load_pcx("db.pcx",NULL);
>}
>
>int main()
>{
> init();
>
> while(1)
> {
> if(key[KEY_ESC]) {remove_keyboard(); break;}
> blit(back, vback, 0, 0, 0, 0, 640, 480);
> blit( map, vback, 0, 0, 447, 0, 192, 480);
> draw();
show_mouse(NULL); // **********
> blit(vback, screen, 0, 0, 0, 0, 640, 480);
> show_mouse(screen);
> clear_to_color(vback, 0);
> }
> close();
> return 0;
>}
>
>
>
>
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
- Raw text -