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:
@@ -129,13 +129,6 @@ public class JmeApp
|
|||||||
_root.updateGeometricState(0f, true);
|
_root.updateGeometricState(0f, true);
|
||||||
_root.updateRenderState();
|
_root.updateRenderState();
|
||||||
|
|
||||||
// create and add our statistics display
|
|
||||||
if (displayStatistics()) {
|
|
||||||
_stats = new StatsDisplay(_display.getRenderer());
|
|
||||||
_stats.updateGeometricState(0f, true);
|
|
||||||
_stats.updateRenderState();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} catch (Throwable t) {
|
} 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
|
* Starts up the main rendering and event processing loop. This method
|
||||||
* will not return until the application is terminated with a call to
|
* will not return until the application is terminated with a call to
|
||||||
@@ -456,15 +464,6 @@ public class JmeApp
|
|||||||
System.exit(0);
|
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
|
* Prepends the necessary bits onto the supplied path to properly
|
||||||
* locate it in our configuration directory.
|
* locate it in our configuration directory.
|
||||||
|
|||||||
Reference in New Issue
Block a user