Mail Archives: djgpp/2000/05/25/12:45:46
Message-ID: | <392D5317.27751FA1@gtcom.net>
|
From: | Krogg <krogg DOT no DOT to DOT spam AT gtcom DOT net>
|
X-Mailer: | Mozilla 4.61 [en] (Win95; U)
|
X-Accept-Language: | en,en-US,en-GB,ja,af
|
MIME-Version: | 1.0
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: palette still dont work... =(
|
References: | <gIRW4.5531$wYl DOT 221161984 AT newsb DOT telia DOT net>
|
Lines: | 55
|
Date: | Thu, 25 May 2000 12:21:43 -0400
|
NNTP-Posting-Host: | 12.6.67.104
|
X-Trace: | eagle.america.net 959271806 12.6.67.104 (Thu, 25 May 2000 12:23:26 EDT)
|
NNTP-Posting-Date: | Thu, 25 May 2000 12:23:26 EDT
|
Organization: | 24hoursupport.com
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Fredrik Persson wrote:
>
> Hi i tried to set_pelette after loading the bitmap but it still just returns
> a black screen..
>
> {
> allegro_init();
> install_keyboard();
> set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
> PALETTE p;
> screen=load_bitmap("drop.bmp",p);
> set_palette(p);
> readkey();
> allegro_exit();
> }
>
> what is wrong??
you are changing where `screen' points to,not sending the
picture to the screen.....
you need to declare a pointer to the picture and load
the picture with that pointer and then BLIT it to the screen.
Here is the changes assuming you are using c.
{
PALETTE p;
BITMAP *MY_PICTURE; //reserve a pointer for your picture
allegro_init();
install_keyboard();
set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
MY_PICTURE=load_bitmap("drop.bmp",p); //load your picture
set_palette(p);
blit(MY_PICTURE,screen,0,0,0,0,319,199);//blit to screen
readkey();
allegro_exit();
}
Hope that helps you
(If anyone sees my canceled post,i had forgot to make a pointer
out of `MY_PICTURE')
--
|"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""|
| `.`/""""""\,',' my sig is too big, |
|SEE HIS ( / \ \' SEE HIS but its really cool. |
| FACE \/<> <>\/ SMILE |
| / W \ Visit my ascii art site: |
| ,'\_|||||_/`. http://www.gtcom.net/~krogg/ascii/ |
| ,',' ||| `.`. krogg DOT no DOT to DOT spam AT gtcom DOT net |
|____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|
- Raw text -