Hi,
I'm currently working with StandardGame as the base of my application.
Until now I've managed to make things work sucessfully (mainly using the GameState architecture), however I'm annoyed by the presence of a PassManager instance in the StandardGame class. Maybe I'm using gamestates incorrectly.
What I have is a LevelRenderState which has the following render method (basically, it renders my level rootNode):
/**
* Draws the level (and debug info, if needed).
*/
public void render(float tpf) {
DisplaySystem.getDisplaySystem().getRenderer().draw(System.getLevel().getRootNode());
if (System.getSettings().getRender().isDrawNormals()) {
Debugger.drawNormals(System.getLevel().getRootNode(), DisplaySystem.getDisplaySystem().getRenderer());
}
if (System.getSettings().getRender().isDrawBounds()) {
Debugger.drawBounds(System.getLevel().getRootNode(), DisplaySystem.getDisplaySystem().getRenderer());
}
if (System.getSettings().getRender().isDrawPhysics()) {
PhysicsDebugger.drawPhysics( System.getLevel().getPhysicsSpace(), DisplaySystem.getDisplaySystem().getRenderer());
}
super.render (tpf);
}
And, in my ConsoleState I have the following render method (it renders the console rootNode):
/**
* Draws the console.
*/
public void render(float tpf) {
DisplaySystem.getDisplaySystem().getRenderer().draw(rootNode);
super.render (tpf);
}
This works nice, as my level is rendered first (with debugging info if needed), then I render anything contained within the LevelRenderState, and then my console will be rendered if its GameState is active.
However, the implementation of the render method in StandardGame is as follows:
protected void render(float interpolation) {
display.getRenderer().clearBuffers();
// Execute renderQueue item
GameTaskQueueManager.getManager().getQueue(GameTaskQueue.RENDER).execute();
GameStateManager.getInstance().render(interpolation);
// Render PassManager
passManager.renderPasses(display.getRenderer());
// Render FPS
display.getRenderer().draw(fpsNode);
}
Does this mean that whatever I put in that passManager will be always rendered after all my GameStates have rendered?
I would prefer to manage my own PassManager in the states where it is needed. I think it suits more the GameState architecture.
Maybe I'm doing things incorrectly calling Renderer.draw() in each state for the geometry contained in that state?
Thanks, and sorry for the poor english :oops: