delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/21/05:05:40

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE301504959@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Help ! Winallegro : Screen to screen blits
Date: Wed, 21 Jul 1999 10:06:21 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019