Allow statistics to be toggled on and off at runtime.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3796 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-12-21 19:41:07 +00:00
parent 4324149cdb
commit 82bcdc13f9
+15 -16
View File
@@ -129,13 +129,6 @@ public class JmeApp
_root.updateGeometricState(0f, true);
_root.updateRenderState();
// create and add our statistics display
if (displayStatistics()) {
_stats = new StatsDisplay(_display.getRenderer());
_stats.updateGeometricState(0f, true);
_stats.updateRenderState();
}
return true;
} catch (Throwable t) {
@@ -144,6 +137,21 @@ public class JmeApp
}
}
/**
* Configures whether or not we display FPS and other statistics atop the
* display.
*/
public void displayStatistics (boolean display)
{
if (display && (_stats == null)) {
_stats = new StatsDisplay(_display.getRenderer());
_stats.updateGeometricState(0f, true);
_stats.updateRenderState();
} else if (!display && (_stats != null)) {
_stats = null;
}
}
/**
* Starts up the main rendering and event processing loop. This method
* will not return until the application is terminated with a call to
@@ -456,15 +464,6 @@ public class JmeApp
System.exit(0);
}
/**
* If true we'll display some renderer statistics at the bottom of the
* screen.
*/
protected boolean displayStatistics ()
{
return false;
}
/**
* Prepends the necessary bits onto the supplied path to properly
* locate it in our configuration directory.