gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP, cubemap); gl.glEnable(GL.GL_TEXTURE_CUBE_MAP);
cubemap.bind(); cubemap.enable();
  private void drawSkyBox(GL gl) {    // Compensates for ExaminerViewer's modification of modelview matrix    gl.glMatrixMode(GL.GL_MODELVIEW);    gl.glLoadIdentity();    gl.glActiveTexture(GL.GL_TEXTURE1);    gl.glDisable(GL.GL_TEXTURE_CUBE_MAP);      gl.glActiveTexture(GL.GL_TEXTURE0);    gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP, cubemap);    gl.glEnable(GL.GL_TEXTURE_CUBE_MAP);    // This is a workaround for a driver bug on Mac OS X where the    // normals are not being sent down to the hardware in    // GL_NORMAL_MAP texgen mode. Temporarily enabling lighting    // causes the normals to be sent down. Thanks to Ken Dyke.    gl.glEnable(GL.GL_LIGHTING);    gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);    gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);    gl.glTexGeni(GL.GL_R, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);    gl.glEnable(GL.GL_TEXTURE_GEN_S);    gl.glEnable(GL.GL_TEXTURE_GEN_T);    gl.glEnable(GL.GL_TEXTURE_GEN_R);    gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);    gl.glMatrixMode(GL.GL_TEXTURE);    gl.glPushMatrix();    gl.glLoadIdentity();    gl.glScalef(1.0f, -1.0f, 1.0f);    viewer.updateInverseRotation(gl);        glut.glutSolidSphere(5.0, 40, 20);    gl.glDisable(GL.GL_LIGHTING);    gl.glPopMatrix();    gl.glMatrixMode(GL.GL_MODELVIEW);    gl.glDisable(GL.GL_TEXTURE_GEN_S);    gl.glDisable(GL.GL_TEXTURE_GEN_T);    gl.glDisable(GL.GL_TEXTURE_GEN_R);  }