How to terminate the device by just pushing cross button?

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
Andrey01
Posts: 57
Joined: Mon Jul 27, 2020 9:08 pm

How to terminate the device by just pushing cross button?

Post by Andrey01 »

The question sounds enough trivial, but a problem is if your app creates an ICameraSceneNode and add it to the scene, after you start up it, your mouse cursor will get "stuck" at the one point and you can't "rip off" it to terminate by pushing the cross button at the upper right corner. It can be obtained by other way, e.g. by catching an event from a keyboard and then closeDevice(). But how to do by such way?
CuteAlien
Admin
Posts: 9646
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to terminate the device by just pushing cross button

Post by CuteAlien »

Not that trivial really. The problem is simply that you are in a mode where you want the mouse to be locked to the window. So if you don't want that anymore you have to get out of that mode.

Most games use the ESC key to switch out from the cursorless playing mode back to some kind of menu mode.
We also that in example 09 when you switch to first person camera view in menu. To get out you have to press ESC.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Andrey01
Posts: 57
Joined: Mon Jul 27, 2020 9:08 pm

Re: How to terminate the device by just pushing cross button

Post by Andrey01 »

Thanks. I`ll look at the tutorial 09.
Post Reply