Windowed Mode Always Crashing Upon Exit
Joachim Arting

Hi! I'm new to this forum so please be gentle with me ;D

I would like to know if there is possible to prevent windowed allegro-applictations
from crashing upon exit?

When I had Windows XP installed, windowed applications did not crash. But since I got Windows 7, every windowed allegro-application I've made have been crashing upon exit.

And by windowed I mean this:
set_gfx_mode( GFX_AUTODETECT_WINDOWED, SCR_W, SCR_H, 0, 0 );

Fullscreen applications never crashes this way.
set_gfx_mode( GFX_AUTODETECT_FULLSCREEN, SCR_W, SCR_H, 0, 0 );

The programs themselves works fine, it's just a bit annoying to see the program stop
answering instead of just closing :P

Is this related to the desktop colordepth?

Any answer is much appreciated! :)

gnolam
  1. Which version of Allegro are you using?

  2. Post more code. In <code></code> tags.

Edgar Reynaldo

Are your programs crashing (windows error message), or are they freezing (non-responsive)? If they're freezing, try calling allegro_exit manually before main returns.

Like Gnolam said, show us code. Show us a minimal example that does this for you.

Joachim Arting

Thank for your replies!

Im using allegro version 4.2.3.1 (atleast those numbers)

The program is freezing (non-responsive) after exiting

This is a minimal example:

#SelectExpand
1#include <allegro.h> 2 3#define SCR_W 640 4#define SCR_H 480 5 6int main() 7{ 8 allegro_init(); 9 10 install_keyboard(); 11 12 set_color_depth( 32 ); 13 set_gfx_mode( GFX_AUTODETECT_WINDOWED, SCR_W, SCR_H, 0, 0 ); 14 15 bool quit = false; 16 17 while ( !quit ) 18 { 19 if ( key[KEY_ESC] ) 20 quit = true; 21 } 22 23 24 return 0; 25} 26END_OF_MAIN()

I tried calling allegro_exit() manually, but it didnt change anything.

If I change GFX_AUTODETECT_WINDOWED, to GFX_AUTODETECT or GFX_AUTODETECT_FULLSCREEN
then this does not happen.

Matthew Leverton

Upgrade to Allegro 4.4, and report back.

Joachim Arting

One thing I forgot to mention is that the "grabber" tool in allegro (windowed), used to create datafiles, also freezes after exiting.

Still trying to update allegro to 4.4.2, but I can't figure out how. Any help?

AMCerasoli

Upgrade to Allegro 5.0, and report back.

gnolam

Still trying to update allegro to 4.4.2, but I can't figure out how. Any help?

Tell us what goes wrong.

Upgrade to Allegro 5.0, and report back.

::)

Joachim Arting

The thing is, I have no clue at all how to update allegro.
I'm using Codeblocks with MinGW as the compiler.

Should I just copy the include-folder from allegro5 to the mingw include-folder, overwriting all files?

Sorry guys, I'm not very experienced with installing libraries.

AMCerasoli

We have a little disorganized wiki with big articles, this one, will allow you to install Allegro 5.0.4 which is the last version compiled for our fellow Michał Cichoń. The tutorial works as a charm, not said by me ;).

Remember that that tutorials explain you how to install allegro(using pre-compiled libraries), doesn't explain you how to build Allegro, those are two very different things... Anyway, read it.

gnolam said:

::)

What?? ;D

Edgar Reynaldo

Still trying to update allegro to 4.4.2, but I can't figure out how. Any help?

You can either download the source from http://alleg.sourceforge.net/download and build it yourself, or you can use the binaries from the Allegro files page.

Joachim Arting

I have successfully installed Allegro 5 and the problem is no more! :D

Unfortunatley, now I have to learn all the functions again :P

Quick question, which Allegro version do you guys recommend overall? Is version 5 better than 4.4?

Thanks for your help! :)

Matthew Leverton

Version 5.

Arthur Kalliokoski

I'm still going to keep A4 around for image utilities, due to the ease of pixel manipulation.

Thread #608484. Printed from Allegro.cc