How can I use RenderPass with GameState's?

Well the questions says it already.

I want to have different Gamestates, and decide in witch Renderpass they will display.



(Like the MainMenuState in the Fenggui pass, ect.)

Absolutly noonw an idea???

Umm, you just create a PassManager and have it render the pass in the GameState you want it rendered in…



(I believe that each GameState should have its own PassManager, rather than sharing them among GameStates.)

I now made some tests with the Renderpasses, but seem to make a basic istake again :confused:



The box is jsut a standart box, and thus should be white, while the Other test object (wich is ortho) is displayed right. Also there is a Font2d, but this one is invisble, probably related to the mistake with the box XD







I can also give my code, but I guess it’s a basic problem, where the code is not needed.

looks like you didn't update the renderstates after attaching the box to the scene

aw I did it again.  :x



Oh I decided to chose another way by now, I created a Renderpass manager, kinda like the GameStateManager, with the main difference, that upon attaching a priority can be set, and that it ues Renderpasses, instet of GameStates. They are then sortred depending on their number, and are each renderd in itself Xd



public class RenderPassManager {
   private static RenderPassManager myself;
   private static Renderer renderer;
   private ArrayList<RenderPassWrapper> RenderPasses = new ArrayList<RenderPassWrapper>();
   
   public static RenderPassManager getInstance() {
      return myself;
   }
   
   public static RenderPassManager create() {
      if(myself == null){
         myself = new RenderPassManager();
         renderer = DisplaySystem.getDisplaySystem().getRenderer();
      }
      return myself;
   }
   
   public void attachRenderPass(RenderPass pass,int Importance, String name) {
      RenderPassWrapper newpasswrap = new RenderPassWrapper(pass,Importance,name);
      RenderPasses.add(newpasswrap);
      Collections.sort(RenderPasses);
   }
   
   public void update(float tpf) {
      for (int i = 0; i < RenderPasses.size(); i++) {
         RenderPassWrapper state = RenderPasses.get(i);
         state.getRenderPass().updatePass(tpf);
      }
   }

   /**
    * Renders all maintained children (calling their render method).
    */
   public void render(float tpf) {
      for (int i = 0; i < RenderPasses.size(); i++) {
         RenderPassWrapper state = RenderPasses.get(i);
         state.getRenderPass().renderPass(renderer);
      }
   }
   
   public void SetActive(String name,boolean active){
      for (int i = 0; i < RenderPasses.size(); i++) {
         RenderPassWrapper state = RenderPasses.get(i);
         if (state.getName().equals(name)){
            state.getRenderPass().setEnabled(active);
         }
      }
   }
}