user1588452
user1588452

Reputation: 33

Allegro 5 al_create_display(x, y) not working

I have set up my allegro 5.0.7 project in MSVC 2010 properly and the code executes. I am able to compile and run programs that will display an error dialog or something. However, whenever I run a program that draws a window, the window is not shown on my screen. I see it minimized with a broken file icon. The code runs with no errors, however. Here is an example of some code that gives me this problem. Thanks!

#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;
}

This code even exits after 10 seconds, as it should. The only problem is that the window is not drawn to the screen. It is only minimized, with a broken file icon. I have Windows 7 64-bit.

Upvotes: 0

Views: 977

Answers (1)

Matthew
Matthew

Reputation: 48294

This is a known bug affecting certain configurations that may be fixed in a more recent version.

Use al_set_window_position() to move the window onscreen.

Upvotes: 1

Related Questions