public TestSceneStress() { super(new StatsAppState(), new DebugKeysAppState(), new BasicProfilerState(false), new FlyCamAppState(), new ScreenshotAppState("", System.currentTimeMillis())); }
@Override protected void onEnable() { // Set the number of visible frames to the current width of the screen setFrameCount(getApplication().getCamera().getWidth()); getApplication().setAppProfiler(profiler); Node gui = ((SimpleApplication)getApplication()).getGuiNode(); gui.attachChild(graph); gui.attachChild(background); }
public void toggleProfiler() { setEnabled(!isEnabled()); }
BasicProfilerState profiler = new BasicProfilerState(true); profiler.setGraphScale(1000f);
/** * Sets the number frames displayed and tracked. * @param count the number of frames */ public void setFrameCount( int count ) { if( profiler.getFrameCount() == count ) { return; } profiler.setFrameCount(count); refreshBackground(); }
@Override protected void onDisable() { getApplication().setAppProfiler(null); graph.removeFromParent(); background.removeFromParent(); }
@Override public void onAction(String name, boolean value, float tpf) { if (!value) { return; } toggleProfiler(); } }
public BasicProfilerState( boolean enabled ) { setEnabled(enabled); this.profiler = new BasicProfiler(); }
@Override protected void initialize( Application app ) { graph = new Geometry("profiler", profiler.getMesh()); Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); mat.setBoolean("VertexColor", true); graph.setMaterial(mat); graph.setLocalTranslation(0, 300, 0); graph.setLocalScale(1, scale, 1); Mesh mesh = new Mesh(); background = new Geometry("profiler.background", mesh); mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); mat.setBoolean("VertexColor", true); mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha); background.setMaterial(mat); background.setLocalTranslation(0, 300, -1); background.setLocalScale(1, scale, 1); refreshBackground(); InputManager inputManager = app.getInputManager(); if( inputManager != null ) { inputManager.addMapping(INPUT_MAPPING_PROFILER_TOGGLE, new KeyTrigger(KeyInput.KEY_F6)); inputManager.addListener(keyListener, INPUT_MAPPING_PROFILER_TOGGLE); } }
@Override protected void onDisable() { getApplication().setAppProfiler(null); graph.removeFromParent(); background.removeFromParent(); }
@Override public void onAction(String name, boolean value, float tpf) { if (!value) { return; } toggleProfiler(); } }
public BasicProfilerState( boolean enabled ) { setEnabled(enabled); this.profiler = new BasicProfiler(); }
@Override protected void onEnable() { // Set the number of visible frames to the current width of the screen setFrameCount(getApplication().getCamera().getWidth()); getApplication().setAppProfiler(profiler); Node gui = ((SimpleApplication)getApplication()).getGuiNode(); gui.attachChild(graph); gui.attachChild(background); }
public void toggleProfiler() { setEnabled(!isEnabled()); }
/** * Sets the number frames displayed and tracked. * @param count the number of frames */ public void setFrameCount( int count ) { if( profiler.getFrameCount() == count ) { return; } profiler.setFrameCount(count); refreshBackground(); }
public ProtoDemo() { super(new StatsAppState(), new DebugKeysAppState(), new BasicProfilerState(false), new OptionPanelState("glass"), new ScreenshotAppState("", System.currentTimeMillis())); }
@Override protected void initialize( Application app ) { graph = new Geometry("profiler", profiler.getMesh()); Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); mat.setBoolean("VertexColor", true); graph.setMaterial(mat); graph.setLocalTranslation(0, 300, 0); graph.setLocalScale(1, scale, 1); Mesh mesh = new Mesh(); background = new Geometry("profiler.background", mesh); mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); mat.setBoolean("VertexColor", true); mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha); background.setMaterial(mat); background.setLocalTranslation(0, 300, -1); background.setLocalScale(1, scale, 1); refreshBackground(); InputManager inputManager = app.getInputManager(); if( inputManager != null ) { inputManager.addMapping(INPUT_MAPPING_PROFILER_TOGGLE, new KeyTrigger(KeyInput.KEY_F6)); inputManager.addListener(keyListener, INPUT_MAPPING_PROFILER_TOGGLE); } }