delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/14/13:06:45

From: "Tarad" <skip_tarad AT 3awebcon DOT com>
Subject: Allegro mode 13h
Newsgroups: comp.os.msdos.djgpp
Message-ID: <01bdf794$4a8e4460$5e9bf482@s-64584>
X-Newsreader: Microsoft Internet News 4.70.1155
Lines: 34
Date: Wed, 14 Oct 1998 17:02:17 GMT
NNTP-Posting-Host: 130.244.155.94
X-Complaints-To: news-abuse AT swip DOT net
X-Trace: nntpserver.swip.net 908384537 130.244.155.94 (Wed, 14 Oct 1998 19:02:17 MET DST)
NNTP-Posting-Date: Wed, 14 Oct 1998 19:02:17 MET DST
Organization: A Customer of Tele2
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hya, I'm kinda new in graphic programming in C/C++ so I deceided to use
allegro for my very first game with real graphic (well mode 13h anyway). I
made this test program to see if I could blit a bitmap to the screen and it
didn't work. Why?

[---Snip---]
#include <allegro.h>

int main(void)
{
   allegro_init();
   set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
   install_keyboard();

   BITMAP *image;
   PALETTE *pal;
   image = create_bitmap(16, 16);
   image = load_bitmap("test.bmp", pal);

   blit(image, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);

   readkey();
   allegro_exit();
   return 0;
}
[---End of Snip---]
compiling with the allegro library I got this error:
game.cc: In function `int main()':
game.cc:12: passing `RGB (*)[256]' as argument 2 of `load_bitmap(char *,
RGB *)'
It have something to do with the palette, I want to use the colors the
image was draw with.
Thanks :-)

- Raw text -


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