	private static void getExtensionClassesAndNames(Map exts, Set exts_names) {
		String version = GL11.glGetString(GL11.GL_VERSION);
		int majorEnd = version.indexOf('.');
		int minorEnd = version.indexOf('.', majorEnd + 1);
		int majorVersion = Integer.parseInt(version.substring(0, majorEnd));
		int minorVersion = Integer.parseInt(version.substring(majorEnd + 1, minorEnd));
		if ( majorVersion == 2 ) {
			addExtensionClass(exts, exts_names, "GL20", "OpenGL20");
			addExtensionClass(exts, exts_names, "GL15", "OpenGL15");
			addExtensionClass(exts, exts_names, "GL14", "OpenGL14");
			addExtensionClass(exts, exts_names, "GL13", "OpenGL13");
			addExtensionClass(exts, exts_names, "GL12", "OpenGL12");
		} else {
			switch ( minorVersion ) {
				case 5:
					addExtensionClass(exts, exts_names, "GL15", "OpenGL15");
				case 4:
					addExtensionClass(exts, exts_names, "GL14", "OpenGL14");
				case 3:
					addExtensionClass(exts, exts_names, "GL13", "OpenGL13");
				case 2:
					addExtensionClass(exts, exts_names, "GL12", "OpenGL12");
			}
		}
		addExtensionClass(exts, exts_names, "EXTTextureCompressionS3TC", "");
		String extensions_string = GL11.glGetString(GL11.GL_EXTENSIONS);
		StringTokenizer tokenizer = new StringTokenizer(extensions_string);
		while ( tokenizer.hasMoreTokens() ) {
			String extension_string = tokenizer.nextToken();
			StringBuffer converted_name = new StringBuffer();
			int gl_prefix_index = extension_string.indexOf("GL_");
			if ( gl_prefix_index == -1 )
				continue;
			if ( "GL_EXT_texture_compression_s3tc".equals(extension_string) ) {
				addExtensionClass(exts, exts_names, "EXTTextureCompressionS3TC", "GL_EXT_texture_compression_s3tc");
			} else if ( "GL_EXT_texture_lod_bias".equals(extension_string) ) {
				addExtensionClass(exts, exts_names, "EXTTextureLODBias", "GL_EXT_texture_lod_bias");
			} else if ( "GL_NV_texture_compression_vtc".equals(extension_string) ) {
				addExtensionClass(exts, exts_names, "NVTextureCompressionVTC", "GL_NV_texture_compression_vtc");
			} else {
				for ( int i = gl_prefix_index + 3; i < extension_string.length(); i++ ) {
					char c;
					if ( extension_string.charAt(i) == '_' ) {
						i++;
						c = Character.toUpperCase(extension_string.charAt(i));
					} else
						c = extension_string.charAt(i);
					converted_name.append(c);
				}
				addExtensionClass(exts, exts_names, converted_name.toString(), extension_string);
			}
		}
		addExtensionClass(exts, exts_names, "ARBBufferObject", null);
		addExtensionClass(exts, exts_names, "ARBProgram", null);
		addExtensionClass(exts, exts_names, "NVProgram", null);
	}

	private static void getExtensionClassesAndNames(Map exts, Set exts_names) {
		String version = GL11.glGetString(GL11.GL_VERSION);
		int majorEnd = version.indexOf('.');
		int minorEnd = -1;
		if (majorEnd != -1) {
			minorEnd = version.indexOf('.', majorEnd + 1);
		} else {
			majorEnd = version.length();
		}
		int majorVersion;
		if (majorEnd == 0) {
			throw new OpenGLException("Unable to determine GL version.");
		}
		majorVersion = Integer.parseInt(version.substring(0, majorEnd));
		int minorVersion;
		if (minorEnd == -1) {
			minorVersion = 0;
		} else {
			minorVersion = Integer.parseInt(version.substring(majorEnd + 1, minorEnd));
		}
		if ( majorVersion == 2 ) {
			addExtensionClass(exts, exts_names, "GL20", "OpenGL20");
			addExtensionClass(exts, exts_names, "GL15", "OpenGL15");
			addExtensionClass(exts, exts_names, "GL14", "OpenGL14");
			addExtensionClass(exts, exts_names, "GL13", "OpenGL13");
			addExtensionClass(exts, exts_names, "GL12", "OpenGL12");
		} else {
			switch ( minorVersion ) {
				case 5:
					addExtensionClass(exts, exts_names, "GL15", "OpenGL15");
				case 4:
					addExtensionClass(exts, exts_names, "GL14", "OpenGL14");
				case 3:
					addExtensionClass(exts, exts_names, "GL13", "OpenGL13");
				case 2:
					addExtensionClass(exts, exts_names, "GL12", "OpenGL12");
			}
		}
		addExtensionClass(exts, exts_names, "EXTTextureCompressionS3TC", "");
		String extensions_string = GL11.glGetString(GL11.GL_EXTENSIONS);
		StringTokenizer tokenizer = new StringTokenizer(extensions_string);
		while ( tokenizer.hasMoreTokens() ) {
			String extension_string = tokenizer.nextToken();
			StringBuffer converted_name = new StringBuffer();
			int gl_prefix_index = extension_string.indexOf("GL_");
			if ( gl_prefix_index == -1 )
				continue;
			if ( "GL_EXT_texture_compression_s3tc".equals(extension_string) ) {
				addExtensionClass(exts, exts_names, "EXTTextureCompressionS3TC", "GL_EXT_texture_compression_s3tc");
			} else if ( "GL_EXT_texture_lod_bias".equals(extension_string) ) {
				addExtensionClass(exts, exts_names, "EXTTextureLODBias", "GL_EXT_texture_lod_bias");
			} else if ( "GL_NV_texture_compression_vtc".equals(extension_string) ) {
				addExtensionClass(exts, exts_names, "NVTextureCompressionVTC", "GL_NV_texture_compression_vtc");
			} else {
				for ( int i = gl_prefix_index + 3; i < extension_string.length(); i++ ) {
					char c;
					if ( extension_string.charAt(i) == '_' ) {
						i++;
						c = Character.toUpperCase(extension_string.charAt(i));
					} else
						c = extension_string.charAt(i);
					converted_name.append(c);
				}
				addExtensionClass(exts, exts_names, converted_name.toString(), extension_string);
			}
		}
		addExtensionClass(exts, exts_names, "ARBBufferObject", null);
		addExtensionClass(exts, exts_names, "ARBProgram", null);
		addExtensionClass(exts, exts_names, "NVProgram", null);
	}
