Ejemplo n.º 1
0
 private void createMacWindow() throws LWJGLException {
   if (getRenderMode() == RenderMode.GL30) {
     if (MacOSXUtils.getOSXVersion() >= 7) {
       ContextAttribs ca = new ContextAttribs(3, 2).withProfileCore(true);
       Display.create(new PixelFormat(8, 24, 0), ca);
     } else {
       throw new UnsupportedOperationException("Cannot create a 3.0 context without OSX 10.7_");
     }
   } else {
     Display.create();
   }
 }
Ejemplo n.º 2
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();
    }
  }