public static void cleanUp() {
   filterCommand.cleanUp();
   pixelShaders.cleanUp();
   tileEngine.cleanUp();
   spriteEngine.cleanUp();
   soundPlay.cleanUp();
 }
  /**
   * Should be called after {@link #initializeServer}
   *
   * @param p_awt TRUE=ZEditor / FALSE=game
   */
  public void initializeClient(boolean p_awt) {

    editing = p_awt;

    Zildo.pdPlugin.init(editing);

    openGLGestion = Zildo.pdPlugin.openGLGestion;
    openGLGestion.init();

    screenConstant = new ScreenConstant(Zildo.viewPortX, Zildo.viewPortY);

    filterCommand = new FilterCommand();
    if (!p_awt) { // No sound in ZEditor
      soundEngine = Zildo.pdPlugin.soundEngine;
      soundPlay = new SoundPlay(soundEngine);
    }

    ortho = Zildo.pdPlugin.ortho;

    if (!p_awt) {
      Zildo.pdPlugin.initFilters();
      filterCommand.addDefaultFilters();
    }

    pixelShaders = Zildo.pdPlugin.pixelShaders;
    if (pixelShaders.canDoPixelShader()) {
      pixelShaders.preparePixelShader();
    }

    spriteEngine = Zildo.pdPlugin.spriteEngine;
    tileEngine = Zildo.pdPlugin.tileEngine;

    spriteDisplay = new SpriteDisplay(spriteEngine);
    mapDisplay = new MapDisplay(null);
    guiDisplay = new GUIDisplay();
    spriteEngine.init(spriteDisplay);

    // GUI
    guiDisplay.setToDisplay_generalGui(false);

    ortho.setOrthographicProjection(false);
  }
  public void renderFrame(boolean p_editor) {
    if (waitingScene != 0) {
      return;
    }

    // long t1 = ZUtils.getTime();

    // Focus camera on player
    if (!p_editor && client.connected) {
      if (mapDisplay.getCurrentMap() != null) {
        mapDisplay.centerCamera();
      }

      // Is Zildo talking with somebody ?
      guiDisplay.manageDialog();
    }

    // long t2 = ZUtils.getTime();

    // Tile engine
    Area[] maps = new Area[] {mapDisplay.getCurrentMap(), mapDisplay.getPreviousMap()};
    tileEngine.updateTiles(mapDisplay.getCamera(), maps, mapDisplay.getCompteur_animation());

    // long t3 = ZUtils.getTime();

    spriteDisplay.updateSpritesClient(mapDisplay.getCamera());

    // long t4 = ZUtils.getTime();

    ClientEngineZildo.openGLGestion.beginScene();

    // // DISPLAY ////

    spriteEngine.initRendering();

    // Display BACKGROUND tiles
    if (mapDisplay.getForeBackController().isDisplayBackground()) {
      tileEngine.render(true);
    }

    // long t5 = ZUtils.getTime();

    // Display BACKGROUND sprites
    if (spriteDisplay.foreBackController.isDisplayBackground()) {
      spriteEngine.render(true);
    }

    // long t6 = ZUtils.getTime();

    // Display FOREGROUND tiles
    if (mapDisplay.getForeBackController().isDisplayForeground()) {
      tileEngine.render(false);
    }

    // long t7 = ZUtils.getTime();

    if (!p_editor) {
      guiDisplay.draw(!client.connected);
    }
    // Display FOREGROUND sprites
    if (spriteDisplay.foreBackController.isDisplayForeground()) {
      spriteEngine.render(false);
    }

    // long t8 = ZUtils.getTime();

    if (Zildo.infoDebug && !p_editor) {
      this.debug();
    }

    if (client.isMultiplayer()) {
      // Does player want to see the scores ? (tab key pressed)
      boolean tabPressed = false;
      KeyboardInstant kbInstant = client.getKbInstant();
      if (kbInstant != null) {
        tabPressed = (client.getKbInstant().isKeyDown(KeysConfiguration.PLAYERKEY_TAB));
      }
      guiDisplay.setToDisplay_scores(tabPressed);
    }

    // long t9 = ZUtils.getTime();

    // System.out.println("t2 = "+(t2-t1)+"ms t3="+(t3-t2)+"ms t4="+(t4-t3)+"ms t5="+(t5-t4)+"ms
    // t6="+(t6-t5)+"ms t7="+(t7-t6)+"ms t8="+(t8-t7)+"ms "+(t9-t8));

    openGLGestion.endScene();
  }