DisplaySystem Close and Open again

Hi,

I'm using jME for rendering a 3D model in a separate window from a stand alone application. The user has the possiblity to stop the rendering by closing the jME window - this will end up in a call to DisplaySystem.close().

However if one opens the window again, the window icon and the debug display (frame rate and stuff) is not displayed anymore.

So I'm wondering what went wrong (I'm using a StandartGame subclass for rendering) or what would be the correct way to close and reopen a jME 'game'?



Greetings,

Marcus

It is probably that your textures are not re-initted when you re-open the game.

Hi,





Im getting a similar problem, but my window is completely white. I call the following cleanup code.



TextureManager.clearCache();
TextureManager.doTextureCleanup();

if (display != null && display.getRenderer() != null)
   display.getRenderer().cleanup();

KeyInput.destroyIfInitalized();
MouseInput.destroyIfInitalized();
JoystickInput.destroyIfInitalized();

DisplaySystem.getDisplaySystem().close();



Is there anything else I should do to make sure my window is properly close?

Alex

Found a partial solution. I get get rid of the white screen and see my model if I use the following:



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



However, my FPS counter is still screwed up. That means I need to find a way to reload the FPS counter textures.

Ok, so the FPS is created by the Text class, which staticly loads its font class. Bad! Now I found this function.



    public static final void resetFontTexture() {
       if (defaultFontTextureState != null) {
          defaultFontTextureState.deleteAll(true);
       }
    }



Problem is, calling this doesn't seem to force the reload. I still get invalid white textures.

Alex

How do you reopen the display system again?

I just create a new SimpleGame.



A;ex