Always the same texture

i used a texture to add it to my terrain.



after this i use the following code to set the appearance of a fenggui item. but if i do that, also the texture of my terrain changes. why that?


 ITexture tex;
        Binding bind = Binding.getInstance();
        try{
            bind.setUseClassLoader(true);
            String filePath="jmetest/monkeymahjongg/images/Monkey.jpg";
            tex = bind.getTexture(filePath);            // Get the entire texture in the file
            Pixmap pixmap= new Pixmap(tex);               // Get the texture part we are interested of
            menubar.getAppearance().add(new PixmapBackground(pixmap, true));   // Add the texture to our container's background
        }catch (IOException e){
            logger.severe("Could not load UI texture");
        }

Did you do an updateRenderState() on the terrain after you added the texture?

sounds like jme is inheriting FengGUI's texture settings.

you might try to invalidate the jme renderstates.



how do you render FengGUI and jme? in different GameStates or Passes or other ways ?

@alric: updateRenderState after terrain building or menu building?



@core-dump:



thats my render method:



protected void render(float interpolation) {
      Renderer r = display.getRenderer();
      r.clearStatistics();
      r.clearBuffers();
      r.draw(rootNode);
      r.clearZBuffer();
      dispGUI.display();
   }

its not so easy to get FengGUI working with jme.

its best to use separate renderstates.



but this at the beginning of the render loop helps:

      for (RenderState r : Renderer.defaultStateList) {
         r.apply();
      }



or

DisplaySystem.getDisplaySystem().getCurrentContext().invalidateStates();





also this might be interesting:
http://www.jmonkeyengine.com/jmeforum/index.php?topic=6481.0