Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Extreme slow down on Windows

This thread is locked; no one can reply to it. rss feed Print
Extreme slow down on Windows
kyborg
Member #15,328
October 2013

Hello,
I am developing my game on Linux, where Allegro runs without any problems and I am trying to port it to Windows. Game is 2D, draws about 2000 bitmaps every frame and on Linux I have 60 fps. When I try to run it on Windows it's about 200x slower, one frame is drawn cca. every two seconds and the slow down is caused by drawing. I tried it on multiple Windows PCs and the game never runs normally. On Windows it was compiled by Visual Studio 2010 and 2008 and the OS was Windows 7.

This is how I am creating display.

#SelectExpand
1ALLEGRO_DISPLAY_MODE *display_mode = new ALLEGRO_DISPLAY_MODE; 2 3 if(game_info::fullscreen) 4 { 5 al_set_new_display_flags(ALLEGRO_FULLSCREEN_WINDOW); 6 al_get_display_mode(al_get_num_display_modes()-1, display_mode); 7 display_width = display_mode->width; 8 display_height = display_mode->height; 9 } 10 else 11 { 12 al_set_new_display_flags(ALLEGRO_RESIZABLE); 13 } 14 15 al_set_new_window_position(10, 10); 16 display = al_create_display(display_width, display_height);

I tried adding ALLEGRO_OPENGL flag but it didn't help.

Also someone else has encountered this bug with my game which was solved by adding al_set_new_window_position(10, 10) and on one computer I have encountered this one with my game and also with the same code as the guy in the thread. I dont want to solve these problems in this thread, just maybe you should know.

PS. Sorry for my English, it's not my native language.

Trent Gamblin
Member #261
April 2000
avatar

Since you say you encountered that second bug, does that mean you're running under a VM? Many VMs don't have very good or any hardware acceleration so if that's what you're doing I'm not surprised it runs slow.

If you're not running in a VM, post your drawing routine, or better yet, a complete example that demonstrates the problem.

Go to: