Error Message

I'm using allegro and I kee getting this when I try opening a image file.

First-chance exception at 0x10005ae9 in Dogfight.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x10005ae9 in Dogfight.exe: 0xC0000005: Access violation reading location 0x00000000.


Here's the code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <allegro.h>

BITMAP *plane=NULL;
BITMAP *background=NULL;



int main()
{
	allegro_init();
	install_keyboard();
	set_color_depth(16);
	set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);

	while (!key[KEY_ESC])
	{
		clear_keybuf();

		acquire_screen();

		background=load_bitmap("myplane_all-around_100hp.tga", NULL);
		blit(background, screen, 0,0,0,0,640,480);

		release_screen();
	}

	destroy_bitmap(background);

	return 0;
}
END_OF_MAIN()
A .tga texture file is NOT a bitmap. Try using load_tga.
I changed it to load_tga but I still got theses 2 errors.

Unhandled exception at 0x10005ae9 in Dogfight.exe: 0xC0000005: Access violation reading location 0x00000000.
Topic archived. No new replies allowed.