www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/18/13:30:54

From: gregorio AT jet DOT es (Grzegorz Adam Hankiewicz)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Hi Color Allegro
Date: Wed, 18 Mar 1998 13:46:51 GMT
Organization: Gogosoftware
Lines: 39
Message-ID: <350fcefb.865813@news.jet.es>
References: <350F6152 DOT 7E6B3136 AT primary DOT net>
NNTP-Posting-Host: infon128.jet.es
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>I'm having problems with blitting pictures to the screen in 16-bit mode
>in allegro...  I am loading 24-bit images but when they are drawn to the
>screen, they look 8 bit and draw _very_ slow.

Try to convert them with grabber directly to 16 bit, and Allegro won't
waste time converting them. Maybe this will speed up the blitting. And
then, reducing them to 16bpp will also give you an idea on how they
will be displayed on the screen (just make sure you didn't forget to
put set_color_depth(16); at the beggining of your code).

>  Also, when I try to blit
>multiple 8-bit images to the 16-bit screen, the entire screen will use
>the palette of the last blitted picture.

Set the first palette, blit the first screen. Then, to show the next
picture clear the screen to black color and set the black palette of
Allegro. Now, while the pal is black, blit your second picture to the
screen, and then change the palette to the second palette, this is,
the palette of the picture you are displaying, not the first one.

Maybe you are forgetting to store the different palettes.

>Finally, is there a way to dynamically allocate BITMAPs in Allegro?  I'm
>trying to load 4 640x480 8-bit images, but it chokes aparently because
>of memory problems...

Hmmm...... but BITMAPs are always dinamic, no?

Just create two bitmaps. Load first image on the first bitmap, and
second on the second bitmap. Display image one, and while you are
displaying image two, load the 3rd image onto bitmap one. Then, show
bitmap one again (which will show pic3) and load pic4 onto the second
bitmap.

By this way you can load/display infinite pictures by using only to
memory bitmaps.

- Grzegorz Adam Hankiewicz - gregorio AT jet DOT es - http://web.jet.es/gregorio
- Gogosoftware - http://web.jet.es/gregorio/gogosoftware

- Raw text -


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