* Allow removal/addition of NiftyJmeDisplay from ViewPort

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10003 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 12 years ago
parent 6bd3ff2f29
commit 5a3a1838f6
  1. 12
      engine/src/niftygui/com/jme3/niftygui/NiftyJmeDisplay.java

@ -100,11 +100,8 @@ public class NiftyJmeDisplay implements SceneProcessor {
soundDev = new SoundDeviceJme(assetManager, audioRenderer);
renderDev = new RenderDeviceJme(this);
inputSys = new InputSystemJme(inputManager);
if (inputManager != null) {
inputManager.addRawInputListener(inputSys);
}
inputSys = new InputSystemJme();
nifty = new Nifty(renderDev, soundDev, inputSys, new TimeProvider());
inputSys.setNifty(nifty);
@ -116,6 +113,10 @@ public class NiftyJmeDisplay implements SceneProcessor {
public void initialize(RenderManager rm, ViewPort vp) {
this.renderManager = rm;
renderDev.setRenderManager(rm);
if (inputManager != null) {
inputSys.setInputManager(inputManager);
inputManager.addRawInputListener(inputSys);
}
inited = true;
this.vp = vp;
this.renderer = rm.getRenderer();
@ -189,7 +190,6 @@ public class NiftyJmeDisplay implements SceneProcessor {
if (inputManager != null) {
inputManager.removeRawInputListener(inputSys);
}
// nifty.exit();
}
}

Loading…
Cancel
Save