Advertisement

Allegro: loading a bitmap

Started by March 02, 2002 03:01 PM
2 comments, last by Pegu 22 years, 6 months ago
Hello, I'm having troubles in Allegro with loading bitmaps. I'm using MinGW compiler (Dev-C++). The following example is from one tutorial about Allegro.

#include <allegro.h>
int main(void)
{
        BITMAP *picture;
        PALETTE pal;

	allegro_init();
	install_keyboard();
	set_gfx_mode(GFX_AUTODETECT,640,480,0,0); 

	picture=load_bitmap("picture.pcx",&pal);
	set_palette(pal);
	blit(picture,screen,0,0,0,0,picture->w,picture->h);

	while(!key[KEY_SPACE]){}

	allegro_exit();
	return(0);
}
  
However, Dev-C++ says following: 12 passing `RGB (*)[256]' as argument 2 of `load_bitmap(const char *, RGB *)' Thanks for help. EDIT: Accidentally typed some stuff in finnish, forgive me Edited by - Pegu on March 2, 2002 5:38:29 PM
kuva=load_bitmap("picture.pcx",pal);
'ROIDRAGE!!! - I wanna work for the chinese communist regime!
Advertisement
quote: Original post by En Dum En
kuva=load_bitmap("picture.pcx",pal);


Thanks ! It now works perfectly.
Now I can sleep... Ahh.
you just just pass NULL for the pallete if your not using 256 color mode...

This topic is closed to new replies.

Advertisement