|
Installing Allegro 5 with Code::Blocks and MinGW problems |
lordalaqua
Member #13,715
November 2011
|
Hello, I'm completely new to allegro, and I have tried every tutorial for installing it I found through the internet, but none seems to work for me. I use Windows 7, 64 bit, Code Blocks 10.5 and I'm trying to install Allegro 5. My latest hope was the one I found on this thread: http://www.allegro.cc/forums/thread/606041 I follow every instruction as it is written, have no problems whatsoever during the installation, even when I build the example program there's no warning. However, when I try run the example, I get: Assertion failed: dm.dmFields & 0x00100000, file C:\CodeBlocks\allegro\src\win\wsystem.c, line 361 And Windows closes the program. From what I've found on the net, this is due to the assertion on the wsystem file in line 361 being false, but I never modified it, so I don't get this problem at all. Thanks for the attention and I hope someone can help me solve this. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Line 361 of src/win/wsystem.c from 5.0.0rc4 is : ASSERT(dm.dmFields & DM_PELSHEIGHT); So DM_PELSHEIGHT is not set, and that is why it fails the assertion. 5.0.0rc4 is pretty old by now, and you should be using a more current version. 5.0.5 just came out. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
AMCerasoli
Member #11,955
May 2010
|
Have you tried the one in the Wiki?.
|
lordalaqua
Member #13,715
November 2011
|
Actually I did, otherwise I wouldn't come here to ask, but I guess it doesn't hurt to try again, when I used the tutorial from the wiki I had a strange problem: Everything compiled OK, but when I ran the program I got the normal black console window I get when compiling any C program, and another window I couldn't see, but it was in the taskbar, and I could see the preview window from windows 7, and there was the program running, but I can't actually see it, just the preview-thing in the taskbar... I don't know if I made myself clear, if not tell me. Does anyone know if this can be fixed, or did I install something wrong? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Sounds like you've been bit by the window position bug - just set the window position manually after creating the display : al_set_new_window_position(0,0); ALLEGRO_DISPLAY* display = al_create_display(800,600); al_set_window_position(0,0);// in case al_set_new_window_position doesn't work
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
lordalaqua
Member #13,715
November 2011
|
Edgar Reynaldo, thank you so much! It worked! |
Edgar Reynaldo
Major Reynaldo
May 2007
|
No problem. If you want to center the window, use al_get_monitor_info. ALLEGRO_MONITOR_INFO i; al_get_monitor_info(ALLEGRO_DEFAULT_DISPLAY_ADAPTER , &i); int monwidth = i.x2 - i.x1;// + 1? int monheight = i.y2 - i.y1;// + 1? al_set_new_display_position((monwidth - windowwidth)/2 , (monheight - windowheight)/2); ALLEGRO_DISPLAY* display = al_create_display(windowwidth , windowheight);
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|