closeDevice Error

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
defx2

closeDevice Error

Post by defx2 »

I get an Memory Error when i press the ESC-Key. but only when he is not in fullscreen mode. Why ??

Code: Select all

		if (event.EventType == EET_KEY_INPUT_EVENT &&
			event.KeyInput.Key == KEY_ESCAPE &&
			event.KeyInput.PressedDown == false)
		{
			device->closeDevice();
		}

There is an Bug in the Forum Search. "Search for all terms" show the same like "Search for any terms" when i search for more than one therms.[/code]
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

I don't use closeDevice (didn't even know it existed). I just use return false; and that works fine for me

:-D
The Robomaniac
Project Head / Lead Programmer
Centaur Force
defx2

Post by defx2 »

where do you insert this "return false". My closeDevice is in the event Receiver.
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

Code: Select all

if (what ever key you want goes here)
{
    return false;
}
The Robomaniac
Project Head / Lead Programmer
Centaur Force
Guest

Post by Guest »

call device->closeDevice() after you leafe your game loop. if you close the device in the eventreceiver it can't return properly from the event loop and things get mixed up. especialy if there are still window messages to handel if operating in window mode.....

so use a "global" boolean which you set to false in the receiver if you want to quit (as Robomaniac suggested) and in the game loop test against that boolean.
level1

Post by level1 »

that Guest was me, sorry
defx2

Post by defx2 »

Thank you. I will try it out on the weekend.
Post Reply