Mail Archives: djgpp/1998/11/15/16:00:41
Message-Id: | <199811152044.UAA07360@remus.clara.net>
|
From: | "Arthur" <arfa AT clara DOT net>
|
To: | <djgpp AT delorie DOT com>
|
Subject: | RE: Still can display Bitmaps
|
Date: | Sun, 15 Nov 1998 20:44:17 -0000
|
X-Priority: | 3 (Normal)
|
X-MSMail-Priority: | Normal
|
X-Mailer: | Microsoft Outlook 8.5, Build 4.71.2173.0
|
In-Reply-To: | <72n9pm$opo$1@autumn.news.rcn.net>
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3
|
Importance: | Normal
|
Reply-To: | djgpp AT delorie DOT com
|
> What is wrong with this code? I am trying to programm a program
> with Allegro
> to make a bitmap display on the screen. how do i do it?
>
> here is the code:
>
> #include <iostream.h>
> #include "allegro.h"
>
> BITMAP *allegro;
> PALLETE pal;
>
> start_allegro();
>
> int main()
> {
>
> start_allegro();
>
> /* Load our bitmap into memory. */
> allegro = load_bitmap("swf.bmp", pal);
> blit(allegro, screen, 0, 0, 0, 0, 640, 480);
>
>
>
> /* Wait for a keypress */
> readkey();
> destroy_bitmap(allegro);
> return 0;
> }
>
> start_allegro()
> {
> install_keyboard();
> set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
> set_palette(pal);
pal does not contain the palette of the picture yet. Move the above line to
just after you load the picture, and it should work.
> }
>
- Raw text -