Mail Archives: djgpp/1997/06/27/20:54:03
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 -