delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/27/20:54:03

Message-Id: <3.0.32.19970624030826.00689bbc@mail.geocities.com>
Date: Tue, 24 Jun 1997 03:59:24 -0300
To: djgpp AT delorie DOT com
From: Guilherme Silveira <thedarkage AT mail DOT geocities DOT com>
Subject: Re: Allegro: Displaying 640x480 PCX file
Mime-Version: 1.0

I think that you want to know how to exec a file like this:
VIEW DARKAGE.PCX
And Load DarkAge.Pcx
Here's:

The function Main should receive two parameters:
void main(int argc, char * argv[]){
	your program...
	pay attention: * argv 
}

So you can read any of your main arguments as following:
	arc=2 (two strings on argv)
	argv[0]=Full path and name of your program
	argv[1]=In that case: DarkAge.Pcx

Now, all that you have to do is open the pcx:

BITMAP *mybitmap;
PALETTE pal;
mybitmap=load_bitmap(argv[1],pal);
set_palette(pal);
draw_sprite(screen,mybitmap,0,0); 

remind: argv[1] - is the first argument for your program, but it's not the
full path and name of your program

Hope help

Guilherme

- Raw text -


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