Esempio n. 1
0
  private void createWindow() {
    try {
      Display.setDisplayMode(new DisplayMode((int) resolution.getX(), (int) resolution.getY()));

      if (MacOSXUtils.isMac()) {
        createMacWindow();
      } else {
        if (getRenderMode() == RenderMode.GL11) {
          ContextAttribs ca = new ContextAttribs(1, 5);
          Display.create(new PixelFormat(8, 24, 0), ca);
        } else if (getRenderMode() == RenderMode.GL20) {
          ContextAttribs ca = new ContextAttribs(2, 1);
          Display.create(new PixelFormat(8, 24, 0), ca);
        } else if (getRenderMode() == RenderMode.GL30) {
          ContextAttribs ca = new ContextAttribs(3, 2).withForwardCompatible(false);
          Display.create(new PixelFormat(8, 24, 0), ca);
        }
      }

      Display.setTitle("Spout Client");
    } catch (LWJGLException e) {
      e.printStackTrace();
    }
  }