www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/02/10:42:42

From: CrashLogix <dwatson AT NOSPAM DOT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Allegro and Fonts
Date: Sun, 02 May 1999 02:41:05 -0400
Lines: 54
Message-ID: <372BF381.5D70@NOSPAM.erols.com>
Mime-Version: 1.0
X-Trace: TtAZVlz4F9XAc8lC3oVQHGkZjGqyHSHEJJSoZG5ejxU=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 2 May 1999 06:43:21 GMT
X-Mailer: Mozilla 3.01C-KC032698 (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


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