frame.setResizable(false);
  public void run(String[] args) {    if (args.length < 6 || args.length > 8) {      usage();    }    try {      int argNo = 0;      if (args[argNo].equals("-cg")) {        useCg = true;        ++argNo;      }      hdrFilename    = args[argNo++];      pbuffer_w      = Integer.parseInt(args[argNo++]);      pbuffer_h      = Integer.parseInt(args[argNo++]);      win_scale      = Float.parseFloat(args[argNo++]);      blurWidth      = Integer.parseInt(args[argNo++]);      blur_scale     = Integer.parseInt(args[argNo++]);      if (argNo < args.length) {        modelFilename = args[argNo++];      }      blur_w = pbuffer_w / blur_scale;      blur_h = pbuffer_h / blur_scale;      win_w  = (int) (pbuffer_w * win_scale);      win_h  = (int) (pbuffer_h * win_scale);    } catch (NumberFormatException e) {      e.printStackTrace();      usage();    }    if (modelFilename != null) {      try {        InputStream in = getClass().getClassLoader().getResourceAsStream(modelFilename);        if (in == null) {          throw new IOException("Unable to open model file " + modelFilename);        }        model = new ObjReader(in);        if (model.getVerticesPerFace() != 3) {          throw new IOException("Sorry, only triangle-based WaveFront OBJ files supported");        }        model.rescale(1.2f / model.getRadius());        ++numModels;        modelno = 5;      } catch (IOException e) {        e.printStackTrace();        System.exit(1);      }    }    b['f'] = true; // fragment programs    b['g'] = true; // glare    b['l'] = true;    b[' '] = true; // animation    b['n'] = true; // upsampling smoothing    try {      InputStream in = getClass().getClassLoader().getResourceAsStream(hdrFilename);      if (in == null) {        throw new IOException("Unable to open HDR file " + hdrFilename);      }      hdr = new HDRTexture(in);      hdr.analyze();      hdr.convert();    } catch (IOException e) {      e.printStackTrace();      System.exit(0);    }    canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());    canvas.addGLEventListener(new Listener());    canvas.setNoAutoRedrawMode(true);    animator = new Animator(canvas);    frame = new Frame("HDR test");    frame.setLayout(new BorderLayout());    frame.setResizable(false);    canvas.setSize(win_w, win_h);        frame.add(canvas, BorderLayout.CENTER);    frame.pack();    frame.show();    canvas.requestFocus();    frame.addWindowListener(new WindowAdapter() {        public void windowClosing(WindowEvent e) {          runExit();        }      });    animator.start();  }