Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Problems with al_create_display and al_show_native_message_box

This thread is locked; no one can reply to it. rss feed Print
Problems with al_create_display and al_show_native_message_box
Ylva_D
Member #15,591
April 2014

I'm having some problems with running Allegro 5.0.10 in Visual C++ 2010 Express on a newly installed Windows 7 (64).

I've just continued working on some code that I last worked with in May 2014. It was working then and the only thing that's different now when it comes to software versions and OS stuff is that I must have newer drivers on my computer now. (The last time I used the same Allegro version, the same Visual studio version, the same C++ code and also Windows 7.)

The code I'm trying to run is simply:

#SelectExpand
1ALLEGRO_DISPLAY* display = NULL; 2 3 if(!al_init()) { 4 al_show_native_message_box(NULL, NULL, NULL,"Failed to initialize allegro!", NULL, NULL); 5 return; 6 } 7 8 display = al_create_display(1280, 720); 9 if(!display) { 10 al_show_native_message_box(NULL, NULL, NULL,"Failed to create display!", NULL, NULL); 11 return; 12 }

al_init seems to work, but the problems are:
1 - al_create_display is not working (when I stepped in the code I saw that the display was initialized to just 0's).
2 - The "al_show_native_message_box" immediately following al_create_display is not working correctly either. It's just an empty popup window (shown in my first attachment) and when I click OK I get an Assertion failure, like in my second attachment. The error says something about keyboard drivers, so I'm wondering about that..

Could it be that my drivers are too new or just not matching this Allegro version and Visual studio version?

I've tried googling for hours about which drivers I need (and about these errors I get) but I couldn't find anything.

Does anyone know what the problem might be?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Ylva_D said:

al_init seems to work, but the problems are:
1 - al_create_display is not working (when I stepped in the code I saw that the display was initialized to just 0's).
2 - The "al_show_native_message_box" immediately following al_create_display is not working correctly either.

You also need to call al_init_native_dialog_addon(), and you are probably trying to create a window the size of the screen which doesn't work it won't let you. I assume 1280x720 is your monitor resolution at the time you run your program? You can use al_set_new_display_flags(ALLEGRO_FULLSCREEN_WINDOW) to create a full screen window or you can just run fullscreen. Windowed is the default though, and that is probably why it is failing.

Go to: