我的调试文件夹中有一个名为“x.bmp”的 114x114 位图和这个简单的代码
#include <allegro.h>
BITMAP *Sprite;
int main(){
allegro_init();
install_keyboard();
set_color_depth(16);
set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
Sprite = load_bitmap( "x.bmp", NULL);
acquire_screen();
draw_sprite(screen, Sprite, 50, 50);
release_screen();
readkey();
return 0;
}
END_OF_MAIN();
但它冻结了,看起来像这样
但是当我只是AllegroTest.exe
通过 Windows 资源管理器运行文件时,它可以工作......
我正在使用 Allegro 4.2.3 和 MSVC++ 2008
编辑:这是我在调试输出窗口中得到的一些有趣的东西:
al-gfx INFO: The driver will wait for vsync.
al-gfx INFO: set_gfx_card success for 640x480x16.
Assert failed at line 250 of c:\users\matthew\desktop\allegro\4.2\include\allegro\inline\draw.inlThe thread 'Win32 Thread' (0x137c) has exited with code -805306369 (0xcfffffff).
The thread 'Win32 Thread' (0x25b8) has exited with code -805306369 (0xcfffffff).
c:\users\matthew 不存在!!!我没有名为 matthew 的用户?