Mail Archives: djgpp/1997/12/13/19:03:23
Julia/Christopher Webb wrote:
> imgSource=load_datafile("striker.dat");
Did you check imgSource for a NULL value, indicating load failure?
if ( (imgSource = load_datafile("striker.dat")) == NULL)
ErrorRoutine();
> When I inspect bmp, it has the value NULL. Is there something I
> overlooked? The load_datafile is called before the graphics mode is
> set -- I'm using a 640x480x15bit mode. Is there something I
> overlooked, or should I have set the mode first?
You don't have to set the graphics mode before loading the datafile, but
you -do- have to initialize Allegro:
if (allegro_init() != 0)
ErrorRoutine();
Also check the return value of all your Allegro calls. If they fail,
there's no reason for your program to continue.
- Raw text -