    public static GLConfig fromgl(GL gl, GLContext ctx, GLCapabilitiesImmutable caps) {
	GLConfig c = new GLConfig();
	try {
	    c.glmajver = glgeti(gl, GL2.GL_MAJOR_VERSION);
	    c.glminver = glgeti(gl, GL2.GL_MINOR_VERSION);
	} catch(GLException e) {
	    c.glmajver = 1;
	    c.glminver = 0;
	}
	c.maxlights = glgeti(gl, GL2.GL_MAX_LIGHTS);
	c.exts = Arrays.asList(gl.glGetString(GL.GL_EXTENSIONS).split(" "));
	c.caps = caps;
	c.pref = GLSettings.defconf(c);
	String slv = glconds(gl, GL2.GL_SHADING_LANGUAGE_VERSION);
	if(slv != null) {
	    Matcher m = slvp.matcher(slv);
	    if(m.find()) {
		try {
		    int major = Integer.parseInt(m.group(1));
		    int minor = Integer.parseInt(m.group(2));
		    if((major > 0) || (major < 256) || (minor >= 0) || (minor < 256))
			c.glslver = (major << 8) | minor;
		} catch(NumberFormatException e) {
		}
	    }
	}
	return(c);
    }

    public static GLConfig fromgl(GL gl, GLContext ctx, GLCapabilitiesImmutable caps) {
	GLConfig c = new GLConfig();
	try {
	    c.glmajver = glgeti(gl, GL2.GL_MAJOR_VERSION);
	    c.glminver = glgeti(gl, GL2.GL_MINOR_VERSION);
	} catch(GOut.GLException e) {
	    c.glmajver = 1;
	    c.glminver = 0;
	}
	c.maxlights = glgeti(gl, GL2.GL_MAX_LIGHTS);
	c.exts = Arrays.asList(gl.glGetString(GL.GL_EXTENSIONS).split(" "));
	c.caps = caps;
	c.pref = GLSettings.defconf(c);
	String slv = glconds(gl, GL2.GL_SHADING_LANGUAGE_VERSION);
	if(slv != null) {
	    Matcher m = slvp.matcher(slv);
	    if(m.find()) {
		try {
		    int major = Integer.parseInt(m.group(1));
		    int minor = Integer.parseInt(m.group(2));
		    if((major > 0) || (major < 256) || (minor >= 0) || (minor < 256))
			c.glslver = (major << 8) | minor;
		} catch(NumberFormatException e) {
		}
	    }
	}
	return(c);
    }
