Mail Archives: djgpp/1999/07/21/05:05:40
Danny Devito writes:
> Here's an example of code I tried (using MS VC++ 6.0/Winallegro 3.0):
You might want to get the latest WIP code from the Allegro site,
which includes a more recent version of the Windows code.
> get_palette(pal);
> image = load_bitmap("allegro.pcx", pal);
There's no need to read the current hardware palette, when the
very next line is going to overwrite it with the palette you
are reading from a disk file.
> //Blit it into offscreen Video RAM
> acquire_bitmap(screen);
> blit(image, screen, 0, 0, 0, 480, 320, 200);
> release_bitmap(screen);
Windows doesn't support large virtual screens, so you can't use
this method of putting bitmaps into offscreen vram. Make a video
bitmap object instead if you want to do this.
> acquire_bitmap(screen);
> destroy_bitmap(screen);
> release_bitmap(screen);
Several things wrong with that:
- you don't need to acquire a bitmap before you destroy it.
- you can't release it after you destroy it, because it
doesn't exist any more!
- you shouldn't be trying to destroy the screen bitmap in
any case. That is special, and managed by Allegro, so things
will go badly wrong if you try to change it yourself.
Shawn Hargreaves.
- Raw text -