Example #1
0
 public void setScreen(GuiScreen screen) {
   if (currentScreen != null) {
     currentScreen.stop();
   }
   currentScreen = screen;
   currentScreen.setSize(WIDTH, HEIGHT);
   currentScreen.start();
 }
Example #2
0
  public void render() {
    if (Display.wasResized()) {
      WIDTH = Display.getWidth();
      HEIGHT = Display.getHeight();
      if (currentScreen != null) {
        currentScreen.setSize(WIDTH, HEIGHT);
      }
    }
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);

    if (currentScreen != null) {
      currentScreen.render();
    }
  }
Example #3
0
 public void update(int tick) {
   if (currentScreen != null) {
     currentScreen.update(tick);
   }
 }