Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » "screen" makes my programs crash

This thread is locked; no one can reply to it. rss feed Print
"screen" makes my programs crash
Zanmoto
Member #8,665
May 2007

I use the Dev-C++ compiler, but recently I moved all the files onto another partition, and ever since, my programs crash when they encounter the "screen" bitmap. I have tested this a number of times. Even programs that were working fine, if I altered them slightly, they would crash when I ran them.

An example:

#include <allegro.h>

int main ()
{
 allegro_init ();
 set_gfx_mode (GFX_AUTODETECT_WINDOWED, 250, 100, 0, 0);
 
 textprintf_ex(screen, font, 0, 0, makecol(0, 0, 0), 0, "Hello World!");
 
 allegro_exit ();
 return 0;
}END_OF_MAIN ()

This compiles perfectly, but crashes when I run it.
P.S. It is definately something wrong with the "screen" bitmap because I have tested it against several of my programs.

LennyLen
Member #5,313
December 2004
avatar

Jonatan Hedborg
Member #4,886
July 2004
avatar

Did you forget that you posted about this like four hours ago?

Please do not double post

-------
Sweden: Free from the shackles of Democracy since 2008-06-18!

Zanmoto
Member #8,665
May 2007

Yeah, but no-one seemed to be helping me so I figured I'd give it one last try, since I only ask questions once every so often.

Jonatan Hedborg
Member #4,886
July 2004
avatar

Uhm, this is a forum, not IRC. You may have to wait at least 12 hours to get an answer. Now you have pretty much erased that chance though.

-------
Sweden: Free from the shackles of Democracy since 2008-06-18!

LennyLen
Member #5,313
December 2004
avatar

Quote:

Yeah, but no-one seemed to be helping me so I figured I'd give it one last try, since I only ask questions once every so often.

You got good advice in that thread which you ignored. Read it again.

Zanmoto
Member #8,665
May 2007

Geez, I am sorry, I don't do forums that often. I usually try to figure stuff out myself, but this has just been bugging me for days now.

Edit: I didn't ignore it, I corrected my code in the third post. If it was as easy as that I would have figured it out ages ago.

spellcaster
Member #1,493
September 2001
avatar

Nope, you didn't. Check the return values. They are there for a reason.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Go to: