Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Windowed Mode Always Crashing Upon Exit

This thread is locked; no one can reply to it. rss feed Print
Windowed Mode Always Crashing Upon Exit
Joachim Arting
Member #13,584
September 2011

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! :)

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

gnolam
Member #2,030
March 2002
avatar

  1. Which version of Allegro are you using?

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

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

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
Member #13,584
September 2011

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.

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

Matthew Leverton
Supreme Loser
January 1999
avatar

Upgrade to Allegro 4.4, and report back.

Joachim Arting
Member #13,584
September 2011

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?

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

AMCerasoli
Member #11,955
May 2010
avatar

Upgrade to Allegro 5.0, and report back.

gnolam
Member #2,030
March 2002
avatar

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.

::)

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Joachim Arting
Member #13,584
September 2011

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.

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

AMCerasoli
Member #11,955
May 2010
avatar

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
Major Reynaldo
May 2007
avatar

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
Member #13,584
September 2011

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! :)

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

Matthew Leverton
Supreme Loser
January 1999
avatar

Arthur Kalliokoski
Second in Command
February 2005
avatar

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

The only way Trump is going to be involved in a landslide is if the land surrounding the White House collapses into the Earth's core. -- bamccaig

Go to: