/** * 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 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); } }
/** * 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 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); } }