Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Allegro 4.2 Slow on Windows 7

This thread is locked; no one can reply to it. rss feed Print
Allegro 4.2 Slow on Windows 7
Mike Geig
Member #12,603
February 2011

Hello everyone, I need to run Allegro 4.2 for legacy and I am running Windows 7 32-bit. The programs run super slow and are prone to crashing. The same programs run fine in Windows XP and on another Windows 7 box (64 bit). Any ideas what I can do to fix my issue?

LennyLen
Member #5,313
December 2004
avatar

The problem might be caused by badly written code, so perhaps you should post it.

Mike Geig
Member #12,603
February 2011

Well, I doubt it since it is a simple demo app:

#SelectExpand
1#include <stdlib.h> 2#include <allegro.h> 3 4int main(void) 5{ 6 allegro_init(); 7 set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); 8 install_keyboard(); 9 10 while(!key[KEY_ESC]) 11 { 12 rectfill(screen, 320, 240, 340, 360, 15); 13 } 14 allegro_exit(); 15} 16END_OF_MAIN();

Matthew Leverton
Supreme Loser
January 1999
avatar

How do you know that runs slowly? It's not doing anything... Does it crash?

Do you always use 8-bit graphics? Those are known to not work well under Windows 7.

The best way to get good performance is:

set_color_depth(desktop_color_depth());

Also, Allegro 4.4 might work better. It's source compatible with 4.2.

One last thing, make sure the Allegro libraries/binaries you use are for your specific compiler version (not a problem if you built it yourself) and that you use the same C or assembly settings during build, as mixing those can cause crashes.

Mike Geig
Member #12,603
February 2011

Thanks Matthew, setting the color depth made the program work great. The only problem there is that my primitives are rendered a very dark, almost black color no matter what color I pass in for them.

Any ideas?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Matthew Leverton
Supreme Loser
January 1999
avatar

When using anything higher than 8-bit color depth, you have to use makecol to get the proper integer representation of a color. (8-bit uses an indexed palette.)

makecol(255,255,255) is white.

As an aside, when using 8-bit mode under Windows, the GFX_GDI driver is probably the most compatible.

Go to: