runExit();
quit = true;
    public void init(GLDrawable drawable) {      GL  gl  = drawable.getGL();      GLU glu = drawable.getGLU();      // Try and disable synch-to-retrace for fastest framerate      if (gl.isFunctionAvailable("wglSwapIntervalEXT")) {        System.err.println("wglSwapIntervalEXT available; disabling sync-to-refresh for best framerate");        gl.wglSwapIntervalEXT(0);             }      else {            System.err.println("wglSwapIntervalEXT not available; cannot disable sync-to-refresh");      }      try {        ensurePresent("glVertexArrayRangeNV");        ensurePresent("glGenFencesNV");        ensurePresent("glSetFenceNV");        ensurePresent("glTestFenceNV");        ensurePresent("glFinishFenceNV");        ensurePresent("glAllocateMemoryNV");      } catch (RuntimeException e) {        runExit();        throw (e);      }                  gl.glEnable(GL.GL_DEPTH_TEST);      gl.glClearColor(0, 0, 0, 0);      gl.glEnable(GL.GL_LIGHT0);      gl.glEnable(GL.GL_LIGHTING);      gl.glEnable(GL.GL_NORMALIZE);      gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, new float[]  {.1f, .1f,    0, 1});      gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[]  {.6f, .6f,  .1f, 1});      gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] { 1,    1, .75f, 1});      gl.glMaterialf(GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, 128.f);      gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0});      gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 0);      // NOTE: it looks like GLUT (or something else) sets up the      // projection matrix in the C version of this demo.      gl.glMatrixMode(GL.GL_PROJECTION);      gl.glLoadIdentity();      glu.gluPerspective(60, 1.0, 0.1, 100);      gl.glMatrixMode(GL.GL_MODELVIEW);      allocateBigArray(gl, true);      allocateBuffersAndFences(gl);      sinArray = new float[SIN_ARRAY_SIZE];      cosArray = new float[SIN_ARRAY_SIZE];      for (int i = 0; i < SIN_ARRAY_SIZE; i++) {        double step = i * 2 * Math.PI / SIN_ARRAY_SIZE;        sinArray[i] = (float) Math.sin(step);        cosArray[i] = (float) Math.cos(step);      }      if (getFlag('v')) {        gl.glEnableClientState(GL.GL_VERTEX_ARRAY_RANGE_NV);        gl.glVertexArrayRangeNV(bufferSize, bigArrayVar);        bigArray = bigArrayVar;      } else {        bigArray = bigArraySystem;      }      setupBuffers();      gl.glEnableClientState(GL.GL_VERTEX_ARRAY);      gl.glEnableClientState(GL.GL_NORMAL_ARRAY);      computeElements();      drawable.addKeyListener(new KeyAdapter() {          public void keyTyped(KeyEvent e) {            dispatchKey(e.getKeyChar());          }        });    }