Mail Archives: djgpp/1999/05/02/10:42:42
Hi!
I have been porting my code from VC++ to DJGPP/Allegro because
basically I got fed up with VC eating itself every other week. I got
Allegro with DJGPP, and, after a little bit of working, I was able to
get it all running nice and smooth.
However, I was trying to use the TTF2PCX program with the
Grabber
utility, to make a font for a test program. Grabber seemed to pick up
the .PCX font fine, and then made the appropriate header file, etc.
Now, when I run the code, I get a GPF on the DATAFILE pointer test_dat,
which has kicked out with a more graceful error now that there's some
more defensive code in place:
#include <stdio.h>
#define alleg_mouse_unused
#define alleg_timer_unused
#include "allegro.h"
#include "test_font.h"
int main()
{
DATAFILE *test_dat = NULL;
allegro_init();
set_color_depth(24);
install_keyboard();
set_color_depth(24);
set_gfx_mode(GFX_AUTODETECT,800,600,0,0);
test_dat = load_datafile("test.dat");
if (test_dat != NULL)
{
textout_centre(screen,test_dat[TEST].dat,"abcd",400,300,96);
readkey();
}
else
{
allegro_exit();
printf("Error loading datafile!");
return(1);
}
remove_keyboard();
unload_datafile(test_dat);
allegro_exit();
return(0);
}
Could someone tell me what might possibly be wrong? I just don't wanna
make a game that uses that stupid 8x8 BIOS font (except for Pong)!
- Raw text -