Application exit...

Started by nuclid, October 30, 2004, 22:50:28

Previous topic - Next topic

nuclid

Hi all!

I'm having problem with LWJGL on my Linux box. When I close application window, it disappears, but process is still running. I need to kill parent java process in order that application exits.

I've tried 0.92 as well as 0.93.

Gentoo Linux
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: RIVA TNT/AGP/3DNOW!
GL_VERSION: 1.5.1 NVIDIA 61.11

Any idea?

oNyx

Closing a window is just triggering an event which causes the window component to hide itself, but the programm itself will continue to run, because well... you just asked one of the components to hide itself.

Say you're using some kind of main loop which runs as long as a flag is set to true. Within that loop you check for Display.isCloseRequested() and if so you set that flag to false (causing the loop to end).

Take a look at lwjgl-source-0.93/src/java/org/lwjgl/examples/Game.java

edit:

If you are wondering why it's like this... it allows you to save settings or ask the user if he/she really wants to quit the application. Btw it's the same with any other language/lib.