Mail Archives: djgpp/1998/04/16/02:22:36
Is your contents of "game.h" right? MAIN_BMP might be defined as the wrong thing
inside "game.h".
TackMast wrote:
> 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 -