mirror of
https://github.com/ysoftdevs/cpp-examples.git
synced 2026-04-27 02:39:05 +02:00
update Allegro example
This commit is contained in:
@@ -18,16 +18,21 @@ int main()
|
|||||||
ALLEGRO_EVENT event;
|
ALLEGRO_EVENT event;
|
||||||
ALLEGRO_BITMAP *image;
|
ALLEGRO_BITMAP *image;
|
||||||
|
|
||||||
al_init();
|
if(!al_init()) {
|
||||||
al_install_keyboard();
|
fprintf(stderr, "failed to initialize allegro!\n");
|
||||||
al_init_image_addon();
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
display = al_create_display(640, 480);
|
display = al_create_display(640, 480);
|
||||||
if (!display)
|
if (!display)
|
||||||
{
|
{
|
||||||
|
fprintf(stderr, "failed to create display!\n");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
al_install_keyboard();
|
||||||
|
al_init_image_addon();
|
||||||
|
|
||||||
// Create Event queue
|
// Create Event queue
|
||||||
event_queue = al_create_event_queue();
|
event_queue = al_create_event_queue();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user