delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/15/16:44:05

From: varobert AT colba DOT net
Message-Id: <3.0.32.19990815161825.007b6ec0@mail.colba.net>
X-Sender: varobert AT mail DOT colba DOT net
X-Mailer: Windows Eudora Pro Version 3.0 (32)
Date: Sun, 15 Aug 1999 16:18:28 -0400
To: djgpp AT delorie DOT com
Subject: Re: Problems with allegro
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

At 05:34 AM 8/15/99 -0700, you wrote:
>I've gotten some basic stuff to work using allegro, Mode-X graphics (i still
>haven't gotten that to work without using a 3rd party library, grrr...) ,
>keyboard, mouse, and I've been able to load bitmaps and draw them on the
>screen.  The problem is when I tried to set the palette, beacuse my picture
>was turning out all wrong colors, but when I did, it gave an error (copied
>below my program).  Is it me, or is it my computer that has a problem?
>
>#include <allegro.h>
>#include <conio.h>
>
>void main()
>    {
>    allegro_init();
>    install_keyboard();
>    install_mouse();
>
>    set_gfx_mode(GFX_MODEX, 320, 240, 320, 480);
>
>    PALETTE *p;

You might want to allocate some memory for you palette. I suggest you use
PALETTE P; instead.

>    BITMAP *belive = load_bmp("c:\\belive.bmp", *p);  // mulder's "I want to

and here, simply "p" and not "*p"

>belive" poster
>    set_palette(*p);  // HERE'S WHERE THE PROBLEM IS

same here.

>
>    draw_sprite(screen, belive, 0, 0);
>
>    getch();
>
>    destroy_bitmap(belive);
>    allegro_exit(); // i know i don't need it, but i'm paranoid
>    }
>
>


- GodOfWar
There is always one more bug.

- Raw text -


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