0
我已经在MSVC 2010中正确设置了我的allegro 5.0.7项目并且代码执行完毕。我能够编译并运行将显示错误对话框或程序的程序。但是,每当我运行绘制窗口的程序时,窗口都不会显示在我的屏幕上。我看到它最小化了一个破损的文件图标。但是,代码无错地运行。下面是一些给我这个问题的代码的例子。谢谢!Allegro 5 al_create_display(x,y)不工作
#include <stdio.h>
#include <allegro5/allegro.h>
int main(int argc, char **argv){
ALLEGRO_DISPLAY *display = NULL;
if(!al_init()) {
fprintf(stderr, "failed to initialize allegro!\n");
return -1;
}
display = al_create_display(640, 480);
if(!display) {
fprintf(stderr, "failed to create display!\n");
return -1;
}
al_clear_to_color(al_map_rgb(0,0,0));
al_flip_display();
al_rest(10.0);
al_destroy_display(display);
return 0;
}
该代码甚至在10秒后退出,因为它应该如此。唯一的问题是窗口没有绘制到屏幕上。它只是被最小化,一个破损的文件图标。我有Windows 7 64位。