Small change to make it possible to intercept window closing actions (in
case we want to do something other than close the application at that time). git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@173 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -193,7 +193,7 @@ public class JmeApp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// enter the main rendering and event processing loop
|
// enter the main rendering and event processing loop
|
||||||
while (!_finished && !_display.isClosing()) {
|
while (!_finished) {
|
||||||
try {
|
try {
|
||||||
// render the current frame
|
// render the current frame
|
||||||
long frameStart = processFrame();
|
long frameStart = processFrame();
|
||||||
@@ -223,6 +223,9 @@ public class JmeApp
|
|||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_display.isClosing()) {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -310,7 +313,7 @@ public class JmeApp
|
|||||||
// enable all of the "quick compares," which means that states will
|
// enable all of the "quick compares," which means that states will
|
||||||
// be refreshed only when necessary
|
// be refreshed only when necessary
|
||||||
Arrays.fill(RenderState.QUICK_COMPARE, true);
|
Arrays.fill(RenderState.QUICK_COMPARE, true);
|
||||||
|
|
||||||
// set up the camera
|
// set up the camera
|
||||||
_camera.setFrustumPerspective(45.0f, width/(float)height, 1, 10000);
|
_camera.setFrustumPerspective(45.0f, width/(float)height, 1, 10000);
|
||||||
Vector3f loc = new Vector3f(0.0f, 0.0f, 25.0f);
|
Vector3f loc = new Vector3f(0.0f, 0.0f, 25.0f);
|
||||||
@@ -366,7 +369,7 @@ public class JmeApp
|
|||||||
|
|
||||||
// make everything opaque by default
|
// make everything opaque by default
|
||||||
_geom.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
|
_geom.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
|
||||||
|
|
||||||
// set up a zbuffer
|
// set up a zbuffer
|
||||||
ZBufferState zbuf = _display.getRenderer().createZBufferState();
|
ZBufferState zbuf = _display.getRenderer().createZBufferState();
|
||||||
zbuf.setEnabled(true);
|
zbuf.setEnabled(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user