delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/14/16:17:50

From: tackmast AT aol DOT com (TackMast)
Newsgroups: comp.os.msdos.djgpp
Subject: allegro datafiles won't work
Lines: 42
Message-ID: <1998041420115800.QAA26920@ladder01.news.aol.com>
NNTP-Posting-Host: ladder01.news.aol.com
Date: 14 Apr 1998 20:11:58 GMT
Organization: AOL http://www.aol.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

the datafiles still won't work for me in allegro. it seems to not be able to
find the datafile, even though there seems to be nothing wrong with my code.
somebody please help, i just can't figure out why this won't work. could it be
an improper djgpp or allegro installation? or might it be because i have
windows 95? heres the code:

#include <stdio.h>
#include <stdlib.h>

#include "allegro.h"

#include "game.h"

main()
{
DATAFILE *data;

allegro_init();
install_keyboard();
install_timer();

data = load_datafile("game.dat");
if(!data){
  allegro_exit();
  printf("datafile not loaded properly\n");
  return -1;
}

set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0);

blit(data[MAIN_BMP].dat, screen, 0, 0, 0, 0, 320, 200);

readkey();

return 0;
}

is there anything wrong with it? BTW, when i compile it into an executable i
recieve no errors, and when i run the executable it just sits there with the
cursor, looking like something needs to be  typed in but when you type anything
in it does nothing, not even display the text you type. what is wrong??? please
help

- Raw text -


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