public static final GL2 getCurrentGL2() throws GLException {
   GLContext curContext = GLContext.getCurrent();
   if (curContext == null) {
     throw new GLException("No OpenGL context current on this thread");
   }
   return curContext.getGL().getGL2();
 }
 private static final GLUgl2ProcAddressTable getGLUProcAddressTable() {
   if (gluProcAddressTable == null) {
     GLContext curContext = GLContext.getCurrent();
     if (curContext == null) {
       throw new GLException("No OpenGL context current on this thread");
     }
     GLDynamicLookupHelper glLookupHelper =
         ((GLContextImpl) curContext).getGLDynamicLookupHelper();
     glLookupHelper.loadGLULibrary();
     GLUgl2ProcAddressTable tmp = new GLUgl2ProcAddressTable(new GLProcAddressResolver());
     tmp.reset(glLookupHelper);
     gluProcAddressTable = tmp;
   }
   return gluProcAddressTable;
 }