text:
package org.lwjgl.opengl;

import java.nio.*;

import org.lwjgl.system.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.system.MemoryUtil.*;

/**
 * The core OpenGL 3.3 functionality. OpenGL 3.3 implementations support revision 3.30 of the OpenGL Shading Language.
 *
 *
Extensions promoted to core in this release:

 *
 *

 *
ARB_shader_bit_encoding

 *
ARB_blend_func_extended

 *
ARB_explicit_attrib_location

 *
ARB_occlusion_query2

 *
ARB_sampler_objects

 *
ARB_texture_rgb10_a2ui

 *
ARB_texture_swizzle

 *
ARB_timer_query

 *
ARB_instanced_arrays

 *
ARB_vertex_type_2_10_10_10_rev

 *

 */
public class GL33 {

	/**
	 * Accepted by the {@code src} and {@code dst} parameters of BlendFunc and BlendFunci, and by the {@code srcRGB}, {@code dstRGB}, {@code srcAlpha} and
	 * {@code dstAlpha} parameters of BlendFuncSeparate and BlendFuncSeparatei.
	 */
	public static final int
		GL_SRC1_COLOR           = 0x88F9,
		GL_ONE_MINUS_SRC1_COLOR = 0x88FA,
		GL_ONE_MINUS_SRC1_ALPHA = 0x88FB;

	/** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and GetDoublev. */
	public static final int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC;

	/** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */
	public static final int GL_ANY_SAMPLES_PASSED = 0x8C2F;

	/** Accepted by the {@code value} parameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions. */
	public static final int GL_SAMPLER_BINDING = 0x8919;

	/**
	 * Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, RenderbufferStorage and
	 * RenderbufferStorageMultisample.
	 */
	public static final int GL_RGB10_A2UI = 0x906F;

	/** Accepted by the {@code pname} parameters of TexParameteri, TexParameterf, TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */
	public static final int
		GL_TEXTURE_SWIZZLE_R = 0x8E42,
		GL_TEXTURE_SWIZZLE_G = 0x8E43,
		GL_TEXTURE_SWIZZLE_B = 0x8E44,
		GL_TEXTURE_SWIZZLE_A = 0x8E45;

	/** Accepted by the {@code pname} parameters of TexParameteriv,  TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */
	public static final int GL_TEXTURE_SWIZZLE_RGBA = 0x8E46;

	/** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */
	public static final int GL_TIME_ELAPSED = 0x88BF;

	/**
	 * Accepted by the {@code target} parameter of GetQueryiv and QueryCounter. Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv,
	 * GetInteger64v, GetFloatv, and GetDoublev.
	 */
	public static final int GL_TIMESTAMP = 0x8E28;

	/** Accepted by the {@code pname} parameters of GetVertexAttribdv, GetVertexAttribfv, and GetVertexAttribiv. */
	public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;

	/**
	 * Accepted by the {@code type} parameter of VertexAttribPointer, VertexPointer, NormalPointer, ColorPointer, SecondaryColorPointer, TexCoordPointer,
	 * VertexAttribP{1234}ui, VertexP*, TexCoordP*, MultiTexCoordP*, NormalP3ui, ColorP*, SecondaryColorP* and VertexAttribP*.
	 */
	public static final int GL_INT_2_10_10_10_REV = 0x8D9F;

	protected GL33() {
		throw new UnsupportedOperationException();
	}

	static boolean isAvailable(GLCapabilities caps, boolean fc) {
		return (fc || checkFunctions(
			caps.glVertexP2ui, caps.glVertexP3ui, caps.glVertexP4ui, caps.glVertexP2uiv, caps.glVertexP3uiv, caps.glVertexP4uiv, caps.glTexCoordP1ui,
			caps.glTexCoordP2ui, caps.glTexCoordP3ui, caps.glTexCoordP4ui, caps.glTexCoordP1uiv, caps.glTexCoordP2uiv, caps.glTexCoordP3uiv,
			caps.glTexCoordP4uiv, caps.glMultiTexCoordP1ui, caps.glMultiTexCoordP2ui, caps.glMultiTexCoordP3ui, caps.glMultiTexCoordP4ui,
			caps.glMultiTexCoordP1uiv, caps.glMultiTexCoordP2uiv, caps.glMultiTexCoordP3uiv, caps.glMultiTexCoordP4uiv, caps.glNormalP3ui, caps.glNormalP3uiv,
			caps.glColorP3ui, caps.glColorP4ui, caps.glColorP3uiv, caps.glColorP4uiv, caps.glSecondaryColorP3ui, caps.glSecondaryColorP3uiv
		)) && checkFunctions(
			caps.glBindFragDataLocationIndexed, caps.glGetFragDataIndex, caps.glGenSamplers, caps.glDeleteSamplers, caps.glIsSampler, caps.glBindSampler,
			caps.glSamplerParameteri, caps.glSamplerParameterf, caps.glSamplerParameteriv, caps.glSamplerParameterfv, caps.glSamplerParameterIiv,
			caps.glSamplerParameterIuiv, caps.glGetSamplerParameteriv, caps.glGetSamplerParameterfv, caps.glGetSamplerParameterIiv,
			caps.glGetSamplerParameterIuiv, caps.glQueryCounter, caps.glGetQueryObjecti64v, caps.glGetQueryObjectui64v, caps.glVertexAttribDivisor,
			caps.glVertexAttribP1ui, caps.glVertexAttribP2ui, caps.glVertexAttribP3ui, caps.glVertexAttribP4ui, caps.glVertexAttribP1uiv,
			caps.glVertexAttribP2uiv, caps.glVertexAttribP3uiv, caps.glVertexAttribP4uiv
		);
	}

	// --- [ glBindFragDataLocationIndexed ] ---

	/** Unsafe version of: {@link #glBindFragDataLocationIndexed BindFragDataLocationIndexed} */
	public static void nglBindFragDataLocationIndexed(int program, int colorNumber, int index, long name) {
		long __functionAddress = GL.getCapabilities().glBindFragDataLocationIndexed;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, program, colorNumber, index, name);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Binds a user-defined varying out variable to a fragment shader color number and index.
	 *
	 * @param program     the name of the program containing varying out variable whose binding to modify
	 * @param colorNumber the color number to bind the user-defined varying out variable to
	 * @param index       the index of the color input to bind the user-defined varying out variable to
	 * @param name        the name of the user-defined varying out variable whose binding to modify
	 */
	public static void glBindFragDataLocationIndexed(int program, int colorNumber, int index, ByteBuffer name) {
		if ( CHECKS )
			checkNT1(name);
		nglBindFragDataLocationIndexed(program, colorNumber, index, memAddress(name));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Binds a user-defined varying out variable to a fragment shader color number and index.
	 *
	 * @param program     the name of the program containing varying out variable whose binding to modify
	 * @param colorNumber the color number to bind the user-defined varying out variable to
	 * @param index       the index of the color input to bind the user-defined varying out variable to
	 * @param name        the name of the user-defined varying out variable whose binding to modify
	 */
	public static void glBindFragDataLocationIndexed(int program, int colorNumber, int index, CharSequence name) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			ByteBuffer nameEncoded = stack.ASCII(name);
			nglBindFragDataLocationIndexed(program, colorNumber, index, memAddress(nameEncoded));
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glGetFragDataIndex ] ---

	/** Unsafe version of: {@link #glGetFragDataIndex GetFragDataIndex} */
	public static int nglGetFragDataIndex(int program, long name) {
		long __functionAddress = GL.getCapabilities().glGetFragDataIndex;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		return callPI(__functionAddress, program, name);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Queries the bindings of color indices to user-defined varying out variables.
	 *
	 * @param program the name of the program containing varying out variable whose binding to query
	 * @param name    the name of the user-defined varying out variable whose index to query
	 */
	public static int glGetFragDataIndex(int program, ByteBuffer name) {
		if ( CHECKS )
			checkNT1(name);
		return nglGetFragDataIndex(program, memAddress(name));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Queries the bindings of color indices to user-defined varying out variables.
	 *
	 * @param program the name of the program containing varying out variable whose binding to query
	 * @param name    the name of the user-defined varying out variable whose index to query
	 */
	public static int glGetFragDataIndex(int program, CharSequence name) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			ByteBuffer nameEncoded = stack.ASCII(name);
			return nglGetFragDataIndex(program, memAddress(nameEncoded));
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glGenSamplers ] ---

	/**
	 * Unsafe version of: {@link #glGenSamplers GenSamplers}
	 *
	 * @param count the number of sampler object names to generate
	 */
	public static void nglGenSamplers(int count, long samplers) {
		long __functionAddress = GL.getCapabilities().glGenSamplers;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, count, samplers);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Generates sampler object names.
	 *
	 * @param samplers a buffer in which the generated sampler object names are stored
	 */
	public static void glGenSamplers(IntBuffer samplers) {
		nglGenSamplers(samplers.remaining(), memAddress(samplers));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Generates sampler object names.
	 */
	public static int glGenSamplers() {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			IntBuffer samplers = stack.callocInt(1);
			nglGenSamplers(1, memAddress(samplers));
			return samplers.get(0);
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glDeleteSamplers ] ---

	/**
	 * Unsafe version of: {@link #glDeleteSamplers DeleteSamplers}
	 *
	 * @param count the number of sampler objects to be deleted
	 */
	public static void nglDeleteSamplers(int count, long samplers) {
		long __functionAddress = GL.getCapabilities().glDeleteSamplers;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, count, samplers);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Deletes named sampler objects.
	 *
	 * @param samplers an array of sampler objects to be deleted
	 */
	public static void glDeleteSamplers(IntBuffer samplers) {
		nglDeleteSamplers(samplers.remaining(), memAddress(samplers));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Deletes named sampler objects.
	 */
	public static void glDeleteSamplers(int sampler) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			IntBuffer samplers = stack.ints(sampler);
			nglDeleteSamplers(1, memAddress(samplers));
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glIsSampler ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Determines if a name corresponds to a sampler object.
	 *
	 * @param sampler a value that may be the name of a sampler object
	 */
	public static boolean glIsSampler(int sampler) {
		long __functionAddress = GL.getCapabilities().glIsSampler;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		return callZ(__functionAddress, sampler);
	}

	// --- [ glBindSampler ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Binds a named sampler to a texturing target.
	 *
	 * @param unit    the index of the texture unit to which the sampler is bound
	 * @param sampler the name of a sampler
	 */
	public static void glBindSampler(int unit, int sampler) {
		long __functionAddress = GL.getCapabilities().glBindSampler;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, unit, sampler);
	}

	// --- [ glSamplerParameteri ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Set the integer value of a sampler parameter.
	 *
	 * @param sampler the sampler object whose parameter to modify
	 * @param pname   the symbolic name of a single-valued sampler parameter. One of:

{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}	{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}	{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}	{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}	{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}

{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}	{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}	{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}	{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}	{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}

	 * @param param   the value of {@code pname}
	 */
	public static void glSamplerParameteri(int sampler, int pname, int param) {
		long __functionAddress = GL.getCapabilities().glSamplerParameteri;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, sampler, pname, param);
	}

	// --- [ glSamplerParameterf ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Float version of {@link #glSamplerParameteri SamplerParameteri}.
	 *
	 * @param sampler the sampler object whose parameter to modify
	 * @param pname   the symbolic name of a single-valued sampler parameter
	 * @param param   the value of {@code pname}
	 */
	public static void glSamplerParameterf(int sampler, int pname, float param) {
		long __functionAddress = GL.getCapabilities().glSamplerParameterf;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, sampler, pname, param);
	}

	// --- [ glSamplerParameteriv ] ---

	/** Unsafe version of: {@link #glSamplerParameteriv SamplerParameteriv} */
	public static void nglSamplerParameteriv(int sampler, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glSamplerParameteriv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Pointer version of {@link #glSamplerParameteri SamplerParameteri}.
	 *
	 * @param sampler the sampler object whose parameter to modify
	 * @param pname   the symbolic name of a sampler parameter. One of:

{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}	{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}	{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}	{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}

{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}	{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}	{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}	{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}

{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}	{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}	{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}

	 * @param params  an array where the value or values of {@code pname} are stored
	 */
	public static void glSamplerParameteriv(int sampler, int pname, IntBuffer params) {
		nglSamplerParameteriv(sampler, pname, memAddress(params));
	}

	// --- [ glSamplerParameterfv ] ---

	/** Unsafe version of: {@link #glSamplerParameterfv SamplerParameterfv} */
	public static void nglSamplerParameterfv(int sampler, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glSamplerParameterfv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Float version of {@link #glSamplerParameteriv SamplerParameteriv}.
	 *
	 * @param sampler the sampler object whose parameter to modify
	 * @param pname   the symbolic name of a sampler parameter
	 * @param params  an array where the value or values of {@code pname} are stored
	 */
	public static void glSamplerParameterfv(int sampler, int pname, FloatBuffer params) {
		nglSamplerParameterfv(sampler, pname, memAddress(params));
	}

	// --- [ glSamplerParameterIiv ] ---

	/** Unsafe version of: {@link #glSamplerParameterIiv SamplerParameterIiv} */
	public static void nglSamplerParameterIiv(int sampler, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glSamplerParameterIiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Pure integer version of {@link #glSamplerParameteriv SamplerParameteriv}.
	 *
	 * @param sampler the sampler object whose parameter to modify
	 * @param pname   the symbolic name of a sampler parameter
	 * @param params  an array where the value or values of {@code pname} are stored
	 */
	public static void glSamplerParameterIiv(int sampler, int pname, IntBuffer params) {
		nglSamplerParameterIiv(sampler, pname, memAddress(params));
	}

	// --- [ glSamplerParameterIuiv ] ---

	/** Unsafe version of: {@link #glSamplerParameterIuiv SamplerParameterIuiv} */
	public static void nglSamplerParameterIuiv(int sampler, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glSamplerParameterIuiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Unsigned pure integer version of {@link #glSamplerParameteriv SamplerParameteriv}.
	 *
	 * @param sampler the sampler object whose parameter to modify
	 * @param pname   the symbolic name of a sampler parameter
	 * @param params  an array where the value or values of {@code pname} are stored
	 */
	public static void glSamplerParameterIuiv(int sampler, int pname, IntBuffer params) {
		nglSamplerParameterIuiv(sampler, pname, memAddress(params));
	}

	// --- [ glGetSamplerParameteriv ] ---

	/** Unsafe version of: {@link #glGetSamplerParameteriv GetSamplerParameteriv} */
	public static void nglGetSamplerParameteriv(int sampler, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glGetSamplerParameteriv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Return the integer value(s) of a sampler parameter.
	 *
	 * @param sampler the name of the sampler object from which to retrieve parameters
	 * @param pname   the symbolic name of a sampler parameter. One of:

{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}	{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}	{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}	{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}	{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}

{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}	{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}	{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}	{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}	{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}

,	{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}

	 * @param params  the sampler parameters
	 */
	public static void glGetSamplerParameteriv(int sampler, int pname, IntBuffer params) {
		if ( CHECKS )
			checkBuffer(params, 1);
		nglGetSamplerParameteriv(sampler, pname, memAddress(params));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Return the integer value(s) of a sampler parameter.
	 *
	 * @param sampler the name of the sampler object from which to retrieve parameters
	 * @param pname   the symbolic name of a sampler parameter. One of:

{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}	{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}	{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}	{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}	{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}

{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}	{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}	{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}	{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}	{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}

,	{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}

	 */
	public static int glGetSamplerParameteri(int sampler, int pname) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			IntBuffer params = stack.callocInt(1);
			nglGetSamplerParameteriv(sampler, pname, memAddress(params));
			return params.get(0);
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glGetSamplerParameterfv ] ---

	/** Unsafe version of: {@link #glGetSamplerParameterfv GetSamplerParameterfv} */
	public static void nglGetSamplerParameterfv(int sampler, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glGetSamplerParameterfv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Float version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}.
	 *
	 * @param sampler the name of the sampler object from which to retrieve parameters
	 * @param pname   the symbolic name of a sampler parameter
	 * @param params  the sampler parameters
	 */
	public static void glGetSamplerParameterfv(int sampler, int pname, FloatBuffer params) {
		if ( CHECKS )
			checkBuffer(params, 1);
		nglGetSamplerParameterfv(sampler, pname, memAddress(params));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Float version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}.
	 *
	 * @param sampler the name of the sampler object from which to retrieve parameters
	 * @param pname   the symbolic name of a sampler parameter
	 */
	public static float glGetSamplerParameterf(int sampler, int pname) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			FloatBuffer params = stack.callocFloat(1);
			nglGetSamplerParameterfv(sampler, pname, memAddress(params));
			return params.get(0);
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glGetSamplerParameterIiv ] ---

	/** Unsafe version of: {@link #glGetSamplerParameterIiv GetSamplerParameterIiv} */
	public static void nglGetSamplerParameterIiv(int sampler, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glGetSamplerParameterIiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}.
	 *
	 * @param sampler the name of the sampler object from which to retrieve parameters
	 * @param pname   the symbolic name of a sampler parameter
	 * @param params  the sampler parameters
	 */
	public static void glGetSamplerParameterIiv(int sampler, int pname, IntBuffer params) {
		if ( CHECKS )
			checkBuffer(params, 1);
		nglGetSamplerParameterIiv(sampler, pname, memAddress(params));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}.
	 *
	 * @param sampler the name of the sampler object from which to retrieve parameters
	 * @param pname   the symbolic name of a sampler parameter
	 */
	public static int glGetSamplerParameterIi(int sampler, int pname) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			IntBuffer params = stack.callocInt(1);
			nglGetSamplerParameterIiv(sampler, pname, memAddress(params));
			return params.get(0);
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glGetSamplerParameterIuiv ] ---

	/** Unsafe version of: {@link #glGetSamplerParameterIuiv GetSamplerParameterIuiv} */
	public static void nglGetSamplerParameterIuiv(int sampler, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glGetSamplerParameterIuiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Unsigned pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}.
	 *
	 * @param sampler the name of the sampler object from which to retrieve parameters
	 * @param pname   the symbolic name of a sampler parameter
	 * @param params  the sampler parameters
	 */
	public static void glGetSamplerParameterIuiv(int sampler, int pname, IntBuffer params) {
		if ( CHECKS )
			checkBuffer(params, 1);
		nglGetSamplerParameterIuiv(sampler, pname, memAddress(params));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Unsigned pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}.
	 *
	 * @param sampler the name of the sampler object from which to retrieve parameters
	 * @param pname   the symbolic name of a sampler parameter
	 */
	public static int glGetSamplerParameterIui(int sampler, int pname) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			IntBuffer params = stack.callocInt(1);
			nglGetSamplerParameterIuiv(sampler, pname, memAddress(params));
			return params.get(0);
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glQueryCounter ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Records the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed.
	 *
	 * @param id     the name of a query object into which to record the GL time
	 * @param target the counter to query. Must be:

{@link #GL_TIMESTAMP TIMESTAMP}

	 */
	public static void glQueryCounter(int id, int target) {
		long __functionAddress = GL.getCapabilities().glQueryCounter;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, id, target);
	}

	// --- [ glGetQueryObjecti64v ] ---

	/** Unsafe version of: {@link #glGetQueryObjecti64v GetQueryObjecti64v} */
	public static void nglGetQueryObjecti64v(int id, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glGetQueryObjecti64v;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, id, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Returns the 64bit integer value of query object parameter.
	 *
	 * @param id     the name of a query object
	 * @param pname  the symbolic name of a query object parameter. One of:

{@link GL15#GL_QUERY_RESULT QUERY_RESULT}	{@link GL15#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}

	 * @param params the requested data
	 */
	public static void glGetQueryObjecti64v(int id, int pname, LongBuffer params) {
		if ( CHECKS )
			checkBuffer(params, 1);
		nglGetQueryObjecti64v(id, pname, memAddress(params));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Returns the 64bit integer value of query object parameter.
	 *
	 * @param id    the name of a query object
	 * @param pname the symbolic name of a query object parameter. One of:

{@link GL15#GL_QUERY_RESULT QUERY_RESULT}	{@link GL15#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}

	 */
	public static long glGetQueryObjecti64(int id, int pname) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			LongBuffer params = stack.callocLong(1);
			nglGetQueryObjecti64v(id, pname, memAddress(params));
			return params.get(0);
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glGetQueryObjectui64v ] ---

	/** Unsafe version of: {@link #glGetQueryObjectui64v GetQueryObjectui64v} */
	public static void nglGetQueryObjectui64v(int id, int pname, long params) {
		long __functionAddress = GL.getCapabilities().glGetQueryObjectui64v;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, id, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Unsigned version of {@link #glGetQueryObjecti64v GetQueryObjecti64v}.
	 *
	 * @param id     the name of a query object
	 * @param pname  the symbolic name of a query object parameter
	 * @param params the requested data
	 */
	public static void glGetQueryObjectui64v(int id, int pname, LongBuffer params) {
		if ( CHECKS )
			checkBuffer(params, 1);
		nglGetQueryObjectui64v(id, pname, memAddress(params));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Unsigned version of {@link #glGetQueryObjecti64v GetQueryObjecti64v}.
	 *
	 * @param id    the name of a query object
	 * @param pname the symbolic name of a query object parameter
	 */
	public static long glGetQueryObjectui64(int id, int pname) {
		MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
		try {
			LongBuffer params = stack.callocLong(1);
			nglGetQueryObjectui64v(id, pname, memAddress(params));
			return params.get(0);
		} finally {
			stack.setPointer(stackPointer);
		}
	}

	// --- [ glVertexAttribDivisor ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Modifies the rate at which generic vertex attributes advance during instanced rendering.
	 *
	 * @param index   the index of the generic vertex attribute
	 * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index}
	 */
	public static void glVertexAttribDivisor(int index, int divisor) {
		long __functionAddress = GL.getCapabilities().glVertexAttribDivisor;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, index, divisor);
	}

	// --- [ glVertexP2ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glVertex2f Vertex2f}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param value the packed value
	 */
	public static void glVertexP2ui(int type, int value) {
		long __functionAddress = GL.getCapabilities().glVertexP2ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, value);
	}

	// --- [ glVertexP3ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glVertex3f Vertex3f}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param value the packed value
	 */
	public static void glVertexP3ui(int type, int value) {
		long __functionAddress = GL.getCapabilities().glVertexP3ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, value);
	}

	// --- [ glVertexP4ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glVertex4f Vertex4f}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param value the packed value
	 */
	public static void glVertexP4ui(int type, int value) {
		long __functionAddress = GL.getCapabilities().glVertexP4ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, value);
	}

	// --- [ glVertexP2uiv ] ---

	/** Unsafe version of: {@link #glVertexP2uiv VertexP2uiv} */
	public static void nglVertexP2uiv(int type, long value) {
		long __functionAddress = GL.getCapabilities().glVertexP2uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, value);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glVertexP2ui VertexP2ui}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param value the packed value
	 */
	public static void glVertexP2uiv(int type, IntBuffer value) {
		if ( CHECKS )
			checkBuffer(value, 1);
		nglVertexP2uiv(type, memAddress(value));
	}

	// --- [ glVertexP3uiv ] ---

	/** Unsafe version of: {@link #glVertexP3uiv VertexP3uiv} */
	public static void nglVertexP3uiv(int type, long value) {
		long __functionAddress = GL.getCapabilities().glVertexP3uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, value);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glVertexP3ui VertexP3ui}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param value the packed value
	 */
	public static void glVertexP3uiv(int type, IntBuffer value) {
		if ( CHECKS )
			checkBuffer(value, 1);
		nglVertexP3uiv(type, memAddress(value));
	}

	// --- [ glVertexP4uiv ] ---

	/** Unsafe version of: {@link #glVertexP4uiv VertexP4uiv} */
	public static void nglVertexP4uiv(int type, long value) {
		long __functionAddress = GL.getCapabilities().glVertexP4uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, value);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glVertexP4ui VertexP4ui}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param value the packed value
	 */
	public static void glVertexP4uiv(int type, IntBuffer value) {
		if ( CHECKS )
			checkBuffer(value, 1);
		nglVertexP4uiv(type, memAddress(value));
	}

	// --- [ glTexCoordP1ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glTexCoord1f TexCoord1f}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glTexCoordP1ui(int type, int coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP1ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, coords);
	}

	// --- [ glTexCoordP2ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glTexCoord2f TexCoord2f}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glTexCoordP2ui(int type, int coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP2ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, coords);
	}

	// --- [ glTexCoordP3ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glTexCoord3f TexCoord3f}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glTexCoordP3ui(int type, int coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP3ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, coords);
	}

	// --- [ glTexCoordP4ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glTexCoord4f TexCoord4f}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glTexCoordP4ui(int type, int coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP4ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, coords);
	}

	// --- [ glTexCoordP1uiv ] ---

	/** Unsafe version of: {@link #glTexCoordP1uiv TexCoordP1uiv} */
	public static void nglTexCoordP1uiv(int type, long coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP1uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glTexCoordP1ui TexCoordP1ui}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glTexCoordP1uiv(int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglTexCoordP1uiv(type, memAddress(coords));
	}

	// --- [ glTexCoordP2uiv ] ---

	/** Unsafe version of: {@link #glTexCoordP2uiv TexCoordP2uiv} */
	public static void nglTexCoordP2uiv(int type, long coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP2uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glTexCoordP2ui TexCoordP2ui}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glTexCoordP2uiv(int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglTexCoordP2uiv(type, memAddress(coords));
	}

	// --- [ glTexCoordP3uiv ] ---

	/** Unsafe version of: {@link #glTexCoordP3uiv TexCoordP3uiv} */
	public static void nglTexCoordP3uiv(int type, long coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP3uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glTexCoordP3ui TexCoordP3ui}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glTexCoordP3uiv(int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglTexCoordP3uiv(type, memAddress(coords));
	}

	// --- [ glTexCoordP4uiv ] ---

	/** Unsafe version of: {@link #glTexCoordP4uiv TexCoordP4uiv} */
	public static void nglTexCoordP4uiv(int type, long coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP4uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glTexCoordP4ui TexCoordP4ui}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glTexCoordP4uiv(int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglTexCoordP4uiv(type, memAddress(coords));
	}

	// --- [ glMultiTexCoordP1ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL13#glMultiTexCoord1f MultiTexCoord1f}.
	 *
	 * @param texture the coordinate set to be modified
	 * @param type    type of packing used on the data. One of:

type	of	packing	used	on	the	data

	 * @param coords  the packed value
	 */
	public static void glMultiTexCoordP1ui(int texture, int type, int coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP1ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, texture, type, coords);
	}

	// --- [ glMultiTexCoordP2ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL13#glMultiTexCoord2f MultiTexCoord2f}.
	 *
	 * @param texture the coordinate set to be modified
	 * @param type    type of packing used on the data. One of:

type	of	packing	used	on	the	data

	 * @param coords  the packed value
	 */
	public static void glMultiTexCoordP2ui(int texture, int type, int coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP2ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, texture, type, coords);
	}

	// --- [ glMultiTexCoordP3ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL13#glMultiTexCoord3f MultiTexCoord3f}.
	 *
	 * @param texture the coordinate set to be modified
	 * @param type    type of packing used on the data. One of:

type	of	packing	used	on	the	data

	 * @param coords  the packed value
	 */
	public static void glMultiTexCoordP3ui(int texture, int type, int coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP3ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, texture, type, coords);
	}

	// --- [ glMultiTexCoordP4ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL13#glMultiTexCoord4f MultiTexCoord4f}.
	 *
	 * @param texture the coordinate set to be modified
	 * @param type    type of packing used on the data. One of:

type	of	packing	used	on	the	data

	 * @param coords  the packed value
	 */
	public static void glMultiTexCoordP4ui(int texture, int type, int coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP4ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, texture, type, coords);
	}

	// --- [ glMultiTexCoordP1uiv ] ---

	/** Unsafe version of: {@link #glMultiTexCoordP1uiv MultiTexCoordP1uiv} */
	public static void nglMultiTexCoordP1uiv(int texture, int type, long coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP1uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, texture, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glMultiTexCoordP1ui MultiTexCoordP1ui}.
	 *
	 * @param texture the coordinate set to be modified
	 * @param type    type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords  the packed value
	 */
	public static void glMultiTexCoordP1uiv(int texture, int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglMultiTexCoordP1uiv(texture, type, memAddress(coords));
	}

	// --- [ glMultiTexCoordP2uiv ] ---

	/** Unsafe version of: {@link #glMultiTexCoordP2uiv MultiTexCoordP2uiv} */
	public static void nglMultiTexCoordP2uiv(int texture, int type, long coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP2uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, texture, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glMultiTexCoordP2ui MultiTexCoordP2ui}.
	 *
	 * @param texture the coordinate set to be modified
	 * @param type    type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords  the packed value
	 */
	public static void glMultiTexCoordP2uiv(int texture, int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglMultiTexCoordP2uiv(texture, type, memAddress(coords));
	}

	// --- [ glMultiTexCoordP3uiv ] ---

	/** Unsafe version of: {@link #glMultiTexCoordP3uiv MultiTexCoordP3uiv} */
	public static void nglMultiTexCoordP3uiv(int texture, int type, long coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP3uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, texture, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glMultiTexCoordP3ui MultiTexCoordP3ui}.
	 *
	 * @param texture the coordinate set to be modified
	 * @param type    type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords  the packed value
	 */
	public static void glMultiTexCoordP3uiv(int texture, int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglMultiTexCoordP3uiv(texture, type, memAddress(coords));
	}

	// --- [ glMultiTexCoordP4uiv ] ---

	/** Unsafe version of: {@link #glMultiTexCoordP4uiv MultiTexCoordP4uiv} */
	public static void nglMultiTexCoordP4uiv(int texture, int type, long coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP4uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, texture, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glMultiTexCoordP4ui MultiTexCoordP4ui}.
	 *
	 * @param texture the coordinate set to be modified
	 * @param type    type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords  the packed value
	 */
	public static void glMultiTexCoordP4uiv(int texture, int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglMultiTexCoordP4uiv(texture, type, memAddress(coords));
	}

	// --- [ glNormalP3ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glNormal3f Normal3f}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glNormalP3ui(int type, int coords) {
		long __functionAddress = GL.getCapabilities().glNormalP3ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, coords);
	}

	// --- [ glNormalP3uiv ] ---

	/** Unsafe version of: {@link #glNormalP3uiv NormalP3uiv} */
	public static void nglNormalP3uiv(int type, long coords) {
		long __functionAddress = GL.getCapabilities().glNormalP3uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version {@link #glNormalP3ui NormalP3ui}.
	 *
	 * @param type   type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param coords the packed value
	 */
	public static void glNormalP3uiv(int type, IntBuffer coords) {
		if ( CHECKS )
			checkBuffer(coords, 1);
		nglNormalP3uiv(type, memAddress(coords));
	}

	// --- [ glColorP3ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glColor3f Color3f}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param color the packed value
	 */
	public static void glColorP3ui(int type, int color) {
		long __functionAddress = GL.getCapabilities().glColorP3ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, color);
	}

	// --- [ glColorP4ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL11#glColor4f Color4f}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param color the packed value
	 */
	public static void glColorP4ui(int type, int color) {
		long __functionAddress = GL.getCapabilities().glColorP4ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, color);
	}

	// --- [ glColorP3uiv ] ---

	/** Unsafe version of: {@link #glColorP3uiv ColorP3uiv} */
	public static void nglColorP3uiv(int type, long color) {
		long __functionAddress = GL.getCapabilities().glColorP3uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, color);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glColorP3ui ColorP3ui}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param color the packed value
	 */
	public static void glColorP3uiv(int type, IntBuffer color) {
		if ( CHECKS )
			checkBuffer(color, 1);
		nglColorP3uiv(type, memAddress(color));
	}

	// --- [ glColorP4uiv ] ---

	/** Unsafe version of: {@link #glColorP4uiv ColorP4uiv} */
	public static void nglColorP4uiv(int type, long color) {
		long __functionAddress = GL.getCapabilities().glColorP4uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, color);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glColorP4ui ColorP4ui}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param color the packed value
	 */
	public static void glColorP4uiv(int type, IntBuffer color) {
		if ( CHECKS )
			checkBuffer(color, 1);
		nglColorP4uiv(type, memAddress(color));
	}

	// --- [ glSecondaryColorP3ui ] ---

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Packed component version of {@link GL14#glSecondaryColor3f SecondaryColor3f}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param color the packed value
	 */
	public static void glSecondaryColorP3ui(int type, int color) {
		long __functionAddress = GL.getCapabilities().glSecondaryColorP3ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, type, color);
	}

	// --- [ glSecondaryColorP3uiv ] ---

	/** Unsafe version of: {@link #glSecondaryColorP3uiv SecondaryColorP3uiv} */
	public static void nglSecondaryColorP3uiv(int type, long color) {
		long __functionAddress = GL.getCapabilities().glSecondaryColorP3uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, type, color);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Pointer version of {@link #glSecondaryColorP3ui SecondaryColorP3ui}.
	 *
	 * @param type  type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param color the packed value
	 */
	public static void glSecondaryColorP3uiv(int type, IntBuffer color) {
		if ( CHECKS )
			checkBuffer(color, 1);
		nglSecondaryColorP3uiv(type, memAddress(color));
	}

	// --- [ glVertexAttribP1ui ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Packed component version of {@link GL20#glVertexAttrib1f VertexAttrib1f}.
	 *
	 * @param index      the index of the generic vertex attribute to be modified
	 * @param type       type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param normalized whether values should be normalized or cast directly to floating-point
	 * @param value      the packed value
	 */
	public static void glVertexAttribP1ui(int index, int type, boolean normalized, int value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP1ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, index, type, normalized, value);
	}

	// --- [ glVertexAttribP2ui ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Packed component version of {@link GL20#glVertexAttrib2f VertexAttrib2f}.
	 *
	 * @param index      the index of the generic vertex attribute to be modified
	 * @param type       type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param normalized whether values should be normalized or cast directly to floating-point
	 * @param value      the packed value
	 */
	public static void glVertexAttribP2ui(int index, int type, boolean normalized, int value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP2ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, index, type, normalized, value);
	}

	// --- [ glVertexAttribP3ui ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Packed component version of {@link GL20#glVertexAttrib3f VertexAttrib3f}.
	 *
	 * @param index      the index of the generic vertex attribute to be modified
	 * @param type       type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param normalized whether values should be normalized or cast directly to floating-point
	 * @param value      the packed value
	 */
	public static void glVertexAttribP3ui(int index, int type, boolean normalized, int value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP3ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, index, type, normalized, value);
	}

	// --- [ glVertexAttribP4ui ] ---

	/**
	 *
OpenGL SDK Reference

	 *
	 * Packed component version of {@link GL20#glVertexAttrib4f VertexAttrib4f}.
	 *
	 * @param index      the index of the generic vertex attribute to be modified
	 * @param type       type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param normalized whether values should be normalized or cast directly to floating-point
	 * @param value      the packed value
	 */
	public static void glVertexAttribP4ui(int index, int type, boolean normalized, int value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP4ui;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callV(__functionAddress, index, type, normalized, value);
	}

	// --- [ glVertexAttribP1uiv ] ---

	/** Unsafe version of: {@link #glVertexAttribP1uiv VertexAttribP1uiv} */
	public static void nglVertexAttribP1uiv(int index, int type, boolean normalized, long value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP1uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, index, type, normalized, value);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Pointer version of {@link #glVertexAttribP1ui VertexAttribP1ui}.
	 *
	 * @param index      the index of the generic vertex attribute to be modified
	 * @param type       type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param normalized whether values should be normalized or cast directly to floating-point
	 * @param value      the packed value
	 */
	public static void glVertexAttribP1uiv(int index, int type, boolean normalized, IntBuffer value) {
		if ( CHECKS )
			checkBuffer(value, 1);
		nglVertexAttribP1uiv(index, type, normalized, memAddress(value));
	}

	// --- [ glVertexAttribP2uiv ] ---

	/** Unsafe version of: {@link #glVertexAttribP2uiv VertexAttribP2uiv} */
	public static void nglVertexAttribP2uiv(int index, int type, boolean normalized, long value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP2uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, index, type, normalized, value);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Pointer version of {@link #glVertexAttribP2ui VertexAttribP2ui}.
	 *
	 * @param index      the index of the generic vertex attribute to be modified
	 * @param type       type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param normalized whether values should be normalized or cast directly to floating-point
	 * @param value      the packed value
	 */
	public static void glVertexAttribP2uiv(int index, int type, boolean normalized, IntBuffer value) {
		if ( CHECKS )
			checkBuffer(value, 1);
		nglVertexAttribP2uiv(index, type, normalized, memAddress(value));
	}

	// --- [ glVertexAttribP3uiv ] ---

	/** Unsafe version of: {@link #glVertexAttribP3uiv VertexAttribP3uiv} */
	public static void nglVertexAttribP3uiv(int index, int type, boolean normalized, long value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP3uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, index, type, normalized, value);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Pointer version of {@link #glVertexAttribP3ui VertexAttribP3ui}.
	 *
	 * @param index      the index of the generic vertex attribute to be modified
	 * @param type       type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param normalized whether values should be normalized or cast directly to floating-point
	 * @param value      the packed value
	 */
	public static void glVertexAttribP3uiv(int index, int type, boolean normalized, IntBuffer value) {
		if ( CHECKS )
			checkBuffer(value, 1);
		nglVertexAttribP3uiv(index, type, normalized, memAddress(value));
	}

	// --- [ glVertexAttribP4uiv ] ---

	/** Unsafe version of: {@link #glVertexAttribP4uiv VertexAttribP4uiv} */
	public static void nglVertexAttribP4uiv(int index, int type, boolean normalized, long value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP4uiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, index, type, normalized, value);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Pointer version of {@link #glVertexAttribP4ui VertexAttribP4ui}.
	 *
	 * @param index      the index of the generic vertex attribute to be modified
	 * @param type       type of packing used on the data. One of:

{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}	{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}

	 * @param normalized whether values should be normalized or cast directly to floating-point
	 * @param value      the packed value
	 */
	public static void glVertexAttribP4uiv(int index, int type, boolean normalized, IntBuffer value) {
		if ( CHECKS )
			checkBuffer(value, 1);
		nglVertexAttribP4uiv(index, type, normalized, memAddress(value));
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glGenSamplers GenSamplers}
	 */
	public static void glGenSamplers(int[] samplers) {
		long __functionAddress = GL.getCapabilities().glGenSamplers;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, samplers.length, samplers);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glDeleteSamplers DeleteSamplers}
	 */
	public static void glDeleteSamplers(int[] samplers) {
		long __functionAddress = GL.getCapabilities().glDeleteSamplers;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, samplers.length, samplers);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glSamplerParameteriv SamplerParameteriv}
	 */
	public static void glSamplerParameteriv(int sampler, int pname, int[] params) {
		long __functionAddress = GL.getCapabilities().glSamplerParameteriv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glSamplerParameterfv SamplerParameterfv}
	 */
	public static void glSamplerParameterfv(int sampler, int pname, float[] params) {
		long __functionAddress = GL.getCapabilities().glSamplerParameterfv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glSamplerParameterIiv SamplerParameterIiv}
	 */
	public static void glSamplerParameterIiv(int sampler, int pname, int[] params) {
		long __functionAddress = GL.getCapabilities().glSamplerParameterIiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glSamplerParameterIuiv SamplerParameterIuiv}
	 */
	public static void glSamplerParameterIuiv(int sampler, int pname, int[] params) {
		long __functionAddress = GL.getCapabilities().glSamplerParameterIuiv;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glGetSamplerParameteriv GetSamplerParameteriv}
	 */
	public static void glGetSamplerParameteriv(int sampler, int pname, int[] params) {
		long __functionAddress = GL.getCapabilities().glGetSamplerParameteriv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(params, 1);
		}
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glGetSamplerParameterfv GetSamplerParameterfv}
	 */
	public static void glGetSamplerParameterfv(int sampler, int pname, float[] params) {
		long __functionAddress = GL.getCapabilities().glGetSamplerParameterfv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(params, 1);
		}
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glGetSamplerParameterIiv GetSamplerParameterIiv}
	 */
	public static void glGetSamplerParameterIiv(int sampler, int pname, int[] params) {
		long __functionAddress = GL.getCapabilities().glGetSamplerParameterIiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(params, 1);
		}
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glGetSamplerParameterIuiv GetSamplerParameterIuiv}
	 */
	public static void glGetSamplerParameterIuiv(int sampler, int pname, int[] params) {
		long __functionAddress = GL.getCapabilities().glGetSamplerParameterIuiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(params, 1);
		}
		callPV(__functionAddress, sampler, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glGetQueryObjecti64v GetQueryObjecti64v}
	 */
	public static void glGetQueryObjecti64v(int id, int pname, long[] params) {
		long __functionAddress = GL.getCapabilities().glGetQueryObjecti64v;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(params, 1);
		}
		callPV(__functionAddress, id, pname, params);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glGetQueryObjectui64v GetQueryObjectui64v}
	 */
	public static void glGetQueryObjectui64v(int id, int pname, long[] params) {
		long __functionAddress = GL.getCapabilities().glGetQueryObjectui64v;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(params, 1);
		}
		callPV(__functionAddress, id, pname, params);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glVertexP2uiv VertexP2uiv}
	 */
	public static void glVertexP2uiv(int type, int[] value) {
		long __functionAddress = GL.getCapabilities().glVertexP2uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(value, 1);
		}
		callPV(__functionAddress, type, value);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glVertexP3uiv VertexP3uiv}
	 */
	public static void glVertexP3uiv(int type, int[] value) {
		long __functionAddress = GL.getCapabilities().glVertexP3uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(value, 1);
		}
		callPV(__functionAddress, type, value);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glVertexP4uiv VertexP4uiv}
	 */
	public static void glVertexP4uiv(int type, int[] value) {
		long __functionAddress = GL.getCapabilities().glVertexP4uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(value, 1);
		}
		callPV(__functionAddress, type, value);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glTexCoordP1uiv TexCoordP1uiv}
	 */
	public static void glTexCoordP1uiv(int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP1uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glTexCoordP2uiv TexCoordP2uiv}
	 */
	public static void glTexCoordP2uiv(int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP2uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glTexCoordP3uiv TexCoordP3uiv}
	 */
	public static void glTexCoordP3uiv(int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP3uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glTexCoordP4uiv TexCoordP4uiv}
	 */
	public static void glTexCoordP4uiv(int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glTexCoordP4uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glMultiTexCoordP1uiv MultiTexCoordP1uiv}
	 */
	public static void glMultiTexCoordP1uiv(int texture, int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP1uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, texture, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glMultiTexCoordP2uiv MultiTexCoordP2uiv}
	 */
	public static void glMultiTexCoordP2uiv(int texture, int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP2uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, texture, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glMultiTexCoordP3uiv MultiTexCoordP3uiv}
	 */
	public static void glMultiTexCoordP3uiv(int texture, int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP3uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, texture, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glMultiTexCoordP4uiv MultiTexCoordP4uiv}
	 */
	public static void glMultiTexCoordP4uiv(int texture, int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glMultiTexCoordP4uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, texture, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glNormalP3uiv NormalP3uiv}
	 */
	public static void glNormalP3uiv(int type, int[] coords) {
		long __functionAddress = GL.getCapabilities().glNormalP3uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(coords, 1);
		}
		callPV(__functionAddress, type, coords);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glColorP3uiv ColorP3uiv}
	 */
	public static void glColorP3uiv(int type, int[] color) {
		long __functionAddress = GL.getCapabilities().glColorP3uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(color, 1);
		}
		callPV(__functionAddress, type, color);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glColorP4uiv ColorP4uiv}
	 */
	public static void glColorP4uiv(int type, int[] color) {
		long __functionAddress = GL.getCapabilities().glColorP4uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(color, 1);
		}
		callPV(__functionAddress, type, color);
	}

	/**
	 *
OpenGL SDK Reference - This function is deprecated and unavailable in the Core profile

	 *
	 * Array version of: {@link #glSecondaryColorP3uiv SecondaryColorP3uiv}
	 */
	public static void glSecondaryColorP3uiv(int type, int[] color) {
		long __functionAddress = GL.getCapabilities().glSecondaryColorP3uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(color, 1);
		}
		callPV(__functionAddress, type, color);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glVertexAttribP1uiv VertexAttribP1uiv}
	 */
	public static void glVertexAttribP1uiv(int index, int type, boolean normalized, int[] value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP1uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(value, 1);
		}
		callPV(__functionAddress, index, type, normalized, value);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glVertexAttribP2uiv VertexAttribP2uiv}
	 */
	public static void glVertexAttribP2uiv(int index, int type, boolean normalized, int[] value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP2uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(value, 1);
		}
		callPV(__functionAddress, index, type, normalized, value);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glVertexAttribP3uiv VertexAttribP3uiv}
	 */
	public static void glVertexAttribP3uiv(int index, int type, boolean normalized, int[] value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP3uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(value, 1);
		}
		callPV(__functionAddress, index, type, normalized, value);
	}

	/**
	 *
OpenGL SDK Reference

	 *
	 * Array version of: {@link #glVertexAttribP4uiv VertexAttribP4uiv}
	 */
	public static void glVertexAttribP4uiv(int index, int type, boolean normalized, int[] value) {
		long __functionAddress = GL.getCapabilities().glVertexAttribP4uiv;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkBuffer(value, 1);
		}
		callPV(__functionAddress, index, type, normalized, value);
	}

}


text:
(function(){
	"use strict";

	KC3StrategyTabs.ships = new KC3StrategyTab("ships");

	KC3StrategyTabs.ships.definition = {
		tabSelf: KC3StrategyTabs.ships,

		shipCache:[],
		options: [],
		// default sorting method to Level
		currentSorters: [{name:"lv", reverse:false}],
		equipMode: 0,
		isLoading: false,
		multiKey: false,

		newFilterRep: {},
		// all sorters
		sorters: {},
		sorterDescCtrl: null,

		/* INIT
		Prepares static data needed
		---------------------------------*/
		init :function(){
			this.prepareSorters();
		},

		/* RELOAD
		Prepares latest ships data
		---------------------------------*/
		reload :function(){
			// Cache ship info
			PlayerManager.loadFleets();
			KC3ShipManager.load();
			KC3GearManager.load();
			this.shipCache = [];
			var ctr, ThisShip, ThisShipData;
			for(ctr in KC3ShipManager.list){
				ThisShip = KC3ShipManager.list[ctr];
				ThisShipData = this.prepareShipData(ThisShip);
				this.shipCache.push(ThisShipData);
			}
		},

		getLastCurrentSorter: function() {
			return this.currentSorters[this.currentSorters.length-1];
		},

		reverseLastCurrentSorter: function() {
			var sorter = this.getLastCurrentSorter();
			sorter.reverse = ! sorter.reverse;
			this.updateSorterDescription();
		},

		// try pushing a new sorter to existing list
		// if the sorter already exists, the its "reverse"
		// value will be filpped.
		pushToCurrentSorters: function(name) {
			var i;
			var found = false;
			for (i=0; !found && i<this.currentSorters.length; ++i) {
				var sorterInfo = this.currentSorters[i];
				if (name === sorterInfo.name) {
					found = true;
					sorterInfo.reverse = ! sorterInfo.reverse;
				}
			}

			if (!found) {
				this.currentSorters.push({
					name: name,
					reverse: false
				});
			}

			this.updateSorterDescription();
		},

		// remove all sorters except the first one
		// returning true means visible ship list needs to be updated.
		cutCurrentSorter: function() {
			if (this.currentSorters.length > 1) {
				this.currentSorters = [ this.currentSorters[0] ];
				this.updateSorterDescription();
				return true;
			}
			return false;
		},

		setCurrentSorter: function(name) {
			var sorter = this.sorters[name];
			console.assert(sorter, "sorter should have been registered");
			this.currentSorters = [ {name: sorter.name, reverse:false} ];
			this.updateSorterDescription();
		},

		updateSorterDescription: function() {
			var self = this;
			var desc = this.currentSorters
				.map(function(sorterInfo) {
					var sorter = self.sorters[sorterInfo.name];
					return sorterInfo.reverse
						? sorter.desc + "(R)"
						: sorter.desc;
				})
				.join(" > ");

			this.sorterDescCtrl.text( desc );
		},

		// create comparator based on current list sorters
		makeComparator: function() {
			function reversed(comparator) {
				return function(a,b) {
					var result = comparator(a,b);
					return result === 0
						? 0
						: result < 0 ? 1 : -1;
				};
			}

			function compose(prevCmp,curCmp) {
				return function(a,b) {
					var prevResult = prevCmp(a,b);
					return prevResult !== 0 ? prevResult : curCmp(a,b);
				};
			}

			var self = this;
			return this.currentSorters
				.map( function(sorterInfo) {
					var sorter = self.sorters[sorterInfo.name];
					return sorterInfo.reverse
						? reversed(sorter.comparator)
						: sorter.comparator;
				})
				.reduce( compose );
		},

		// prepares necessary info.
		// also stores those that doesn't need to be recomputed overtime.
		prepareShipData: function(ship) {
			var ThisShip = ship;
			var MasterShip = ThisShip.master();
			var cached =  {
				id: ThisShip.rosterId,
				bid : ThisShip.masterId,
				stype: MasterShip.api_stype,
				english: ThisShip.name(),
				level: ThisShip.level,
				morale: ThisShip.morale,
				equip: ThisShip.items,
				locked: ThisShip.lock,

				hp: ThisShip.hp[0],
				fp: [MasterShip.api_houg[1], MasterShip.api_houg[0]+ThisShip.mod[0], ThisShip.fp[0] ],
				tp: [MasterShip.api_raig[1], MasterShip.api_raig[0]+ThisShip.mod[1], ThisShip.tp[0] ],
				yasen: [
					MasterShip.api_houg[1] + MasterShip.api_raig[1],
					MasterShip.api_houg[0]+ThisShip.mod[0] + MasterShip.api_raig[0]+ThisShip.mod[1],
					ThisShip.fp[0] + ThisShip.tp[0]
				],
				aa: [MasterShip.api_tyku[1], MasterShip.api_tyku[0]+ThisShip.mod[2], ThisShip.aa[0] ],
				ar: [MasterShip.api_souk[1], MasterShip.api_souk[0]+ThisShip.mod[3], ThisShip.ar[0] ],
				as: [this.getDerivedStatNaked("tais", ThisShip.as[0], ThisShip), ThisShip.as[0] ],
				ev: [this.getDerivedStatNaked("houk", ThisShip.ev[0], ThisShip), ThisShip.ev[0] ],
				ls: [this.getDerivedStatNaked("saku", ThisShip.ls[0], ThisShip), ThisShip.ls[0] ],
				lk: ThisShip.lk[0],
				sp: ThisShip.speed,
				slots: ThisShip.slots,
				exSlot: ThisShip.ex_item,
				fleet: ThisShip.onFleet(),
				ship: ThisShip,
				master: ThisShip.master(),
				// Check whether remodel is max
				remodel: RemodelDb.isFinalForm(ship.masterId),
				canEquipDaihatsu: ThisShip.canEquipDaihatsu()
			};
			var ThisShipData = cached;
			// Check whether modernization is max
			if( ThisShipData.fp[0] == ThisShipData.fp[1]
				&& ThisShipData.tp[0] == ThisShipData.tp[1]
				&& ThisShipData.aa[0] == ThisShipData.aa[1]
				&& ThisShipData.ar[0] == ThisShipData.ar[1]
			  )
				ThisShipData.statmax = 1;
			else
				ThisShipData.statmax = 0;
			return cached;
		},

		/* EXECUTE
		Places data onto the interface
		---------------------------------*/
		execute :function(){
			// now we need to do this before preparing filters
			// Ship types
			var sCtr, cElm;

			for(sCtr in KC3Meta._stype){
				// stype 1, 12, 15 not used by shipgirl
				if(KC3Meta._stype[sCtr] && ["1", "12", "15"].indexOf(sCtr) < 0){
					cElm = $(".tab_ships .factory .ship_filter_type").clone().appendTo(".tab_ships .filters .ship_types");
					cElm.data("id", sCtr);
					$(".filter_name", cElm).text(KC3Meta.stype(sCtr));
				}
			}

			this.sorterDescCtrl = $(".advanced_sorter .sorter_desc");
			this.updateSorterDescription();

			var self = this;
			var multiKeyCtrl = $( ".advanced_sorter .adv_sorter" );

			function updateControl() {
				$(".filter_check",multiKeyCtrl).toggle( self.multiKey );
				self.sorterDescCtrl.toggle(self.multiKey);
			}

			updateControl();

			multiKeyCtrl.on("click", function() {
				self.multiKey = ! self.multiKey;

				updateControl();

				if (! self.multiKey) {
					var needUpdate = self.cutCurrentSorter();
					if (needUpdate)
						self.refreshTable();
				}
			});

			$(".pages_yes").on("click", function(){
				$(".ingame_page").show();
			});
			$(".pages_no").on("click", function(){
				$(".ingame_page").hide();
			});

			this.prepareFilters();
			this.shipList = $(".tab_ships .ship_list");
			this.showFilters();
		},

		// default UI actions for options that are mutually exclusive
		// NOTE: this function is supposed to be a shared callback function
		// and should not be called directly.
		_mutualExclusiveOnToggle: function(selectedInd,optionRep,initializing) {
			// mutural exclusive options use just value indices
			// as the option value
			var oldVal = optionRep.curValue;
			if (oldVal === selectedInd)
				return;
			// first update value
			optionRep.curValue = selectedInd;
			// then update UI accordingly
			$.each(optionRep.options, function(thisInd, optionObj) {
				optionObj.view.toggleClass('on', thisInd === selectedInd);
			});
			// only trigger update when it's not the first time
			// first time we just need to give it a initial value (default value)
			// and then upate UI.
			if (!initializing)
				this.refreshTable();
		},

		// findView given filter's name and this option
		// NOTE: this function is supposed to be a shared callback function
		// and should not be called directly.
		_commonFindView: function(filterName, option) {
			return $(".tab_ships .filters .massSelect"
					 +" ." + filterName
					 + "_" + option);
		},

		/*
		   defineShipFilter defines a filter that has UI controls.

		   see comments on each arguments for detail.
		 */
		defineShipFilter: function(
			// a string name for this filter
			filterName,
			// ship filters can hold a piece of value
			// which represents its state.
			// (e.g. true / false for keeping track of whether
			//  this filter is enabled or disable)
			defValue,
			// an array of arbitrary values, each of the option should
			// correspond to a toggle / control on UI
			options,
			// a callback function testShip(curVal,ship)
			// that does the actual fitlering:
			// returning a falsy value means
			// the ship should be filtered out from the list.
			// curVal is the current state of the filter.
			testShip,
			// findView(filterName,option) should return
			// a jQuery object that represents the UI control specified by
			// "filterName" and "option", where "option" is one value from "options"
			// note that the length of the jquery object has to be exactly one,
			// otherwise you'll see assertion failures in the console.
			findView,
			// onToggle(newVal,optionRep,initializing) that triggers either when initializing
			// or when user has changed something on UI.
			// optionRep is the runtime representation of this filter:
			// * optionRep.curValue represents the current value
			//   held by this filter, when initializing, this value is set to "null".
			// * optionRep.options is the runtime representation of
			//   all options you have passed to this function.
			//   for all valid options indices ind
			//   * optionRep.options[ind].name is set to options[ind]
			//   * optionRep.options[ind].view is set to the jQuery object returned
			//     by your "findView".
			// * initializing: newly added to help indicate whether we are initializing
			// your onToggle is responsible for 2 things:
			// * when initalizing a filter, "optionRep.curValue" is set to "null",
			//   in this case "newVal" is "defValue" you passed to this function,
			//   you should do something like "optionRep.curValue = newVal"
			//   to complete initializing filter state. and update UI accordingly
			//   (but avoid refreshing ship list, since we are just initalizing)
			// * when user does something on UI, your onToggle function will be triggered.
			//   in this case "newVal" is set to an index of "options" to indicate
			//   which option triggers this function. in this case you are responsible
			//   for updating "optionRep.curValue" accordingly, updating UI to reflect the change
			//   and finally refresh ship list to execute all filters.
			onToggle) {
			var self = this;
			// as most filters are groups of mutually exclusive controls
			// it makes sense setting them as defaults
			if (! findView)
				findView = this._commonFindView;
			if (! onToggle)
				onToggle = this._mutualExclusiveOnToggle;

			var newOptions = [];
			$.each(options, function(ind, optionName) {
				var thisOption = {};
				var view = findView(filterName,optionName);
				thisOption.name = optionName;
				thisOption.view = view;
				thisOption.view.on('click', function() {
					var curRep = self.newFilterRep[filterName];
					var selectedInd = ind;
					curRep.onToggle.call(self,selectedInd,curRep,false);
				});
				console.assert(
					thisOption.view.length === 1,
					"expecting exactly one result of getView on "
						+ filterName  + "," + optionName );
				newOptions.push( thisOption );
			});

			var optionRep = {
				curValue: null,
				options: newOptions,
				onToggle: onToggle,
				testShip: function (ship) {
					return testShip(optionRep.curValue,ship);
				}
			};

			this.newFilterRep[filterName] = optionRep;
			optionRep.onToggle.call(self,defValue,optionRep,true);
		},

		prepareFilters: function() {
			var self = this;
			self.defineShipFilter(
				"marriage",
				0,
				[ "in","on","ex" ],
				function(curVal, ship) {
					return (curVal === 0)
						|| (curVal === 1 && ship.level >= 100)
						|| (curVal === 2 && ship.level <  100);
				});

			self.defineShipFilter(
				"remodel",
				0,
				["all","max","nomax"],
				function(curVal, ship) {
					return (curVal === 0)
						|| (curVal === 1 && ship.remodel)
						|| (curVal === 2 && !ship.remodel);
				});

			self.defineShipFilter(
				"modernization",
				0,
				["all","max","nomax"],
				function(curVal, ship) {
					return (curVal === 0)
						|| (curVal === 1 && ship.statmax)
						|| (curVal === 2 && !ship.statmax);
				});

			self.defineShipFilter(
				"heartlock",
				 0,
				["all","yes","no"],
				function(curVal, ship) {
					return (curVal === 0)
						|| (curVal === 1 && ship.locked === 1)
						|| (curVal === 2 && ship.locked === 0);
				});

			self.defineShipFilter(
				"speed",
				0,
				["all","slow","fast","faster","fastest"],
				function(curVal,ship) {
					return (curVal === 0)
						|| (curVal === 1 && ship.sp > 0 && ship.sp < 10)
						|| (curVal === 2 && ship.sp >= 10 && ship.sp < 15)
						|| (curVal === 3 && ship.sp >= 15 && ship.sp < 20)
						|| (curVal === 4 && ship.sp >= 20);
				});

			self.defineShipFilter(
				"fleet",
				0,
				["all", "yes","no"],
				function(curVal,ship) {
					return (curVal === 0)
						|| (curVal === 1 && ship.fleet)
						|| (curVal === 2 && !ship.fleet);
				});

			self.defineShipFilter(
				"sparkle",
				0,
				["all", "yes","no"],
				function(curVal, ship) {
					return (curVal === 0)
						|| (curVal === 1 && ship.morale >= 50)
						|| (curVal === 2 && ship.morale < 50);
				});
			self.defineShipFilter(
				"daihatsu",
				0,
				["all", "yes","no"],
				function(curVal, ship) {
					return (curVal === 0)
						|| (curVal === 1 && ship.canEquipDaihatsu)
						|| (curVal === 2 && !ship.canEquipDaihatsu);
				});
			self.defineShipFilter(
				"exslot",
				0,
				["all", "yes","no"],
				function(curVal, ship) {
					return (curVal === 0)
						|| (curVal === 1 && (ship.exSlot > 0 || ship.exSlot === -1))
						|| (curVal === 2 && ship.exSlot === 0);
				});

			var stypes = Object
				.keys(KC3Meta._stype)
				.map(function(x) { return parseInt(x,10); })
				.filter(function(x) { return [1,12,15].indexOf(x)<0; })
				.sort(function(a,b) { return a-b; });
			console.assert(stypes[0] === 0);
			// remove initial "0", which is invalid
			stypes.shift();
			var stypeDefValue = [];
			$.each(stypes, function(ignore, stype) {
				stypeDefValue[stype] = true;
			});

			self.defineShipFilter(
				"stype",
				stypeDefValue,
				// valid ship types and addtionally 3 controls
				stypes.concat(["all","none","invert"]),
				// testShip
				function(curVal,ship) {
					return curVal[ship.stype];
				},
				// find view
				function (filterName,option) {
					if (typeof option === "number") {
						// this is a ship type toggle
						return $(".tab_ships .filters .ship_types .ship_filter_type")
							.filter( function() {  return $(this).data("id") === "" + option;  }  );
					} else {
						// one of: all / none / invert
						return $(".tab_ships .filters .massSelect ." + option);
					}
				},
				// onToggle
				function(selectedInd, optionRep,initializing) {
					if (initializing) {
						// the variable name is a bit misleading..
						// but at this point we should set the initial value
						optionRep.curValue = selectedInd;
					} else {
						var selected = optionRep.options[selectedInd];
						if (typeof selected.name === 'number') {
							// this is a ship type toggle
							optionRep.curValue[selected.name] = !optionRep.curValue[selected.name];
						} else {
							$.each(stypes, function(ignore, stype) {
								optionRep.curValue[stype] =
									(selected.name === "all")
									? true
									: (selected.name === "none")
									? false
									: ! optionRep.curValue[stype];
							});
						}
					}
					// update UI
					$.each(optionRep.options, function(ignored, x) {
						if (typeof x.name === "number") {
							$( ".filter_check", x.view ).toggle( optionRep.curValue[x.name]  );
						}
					});

					if (!initializing)
						self.refreshTable();
				}
			);
		},

		// execute all registered filters on a ship
		executeFilters: function(ship) {
			var filterKeys = Object.keys(this.newFilterRep);
			var i;
			for (i=0;i<filterKeys.length;++i) {
				var key = filterKeys[i];
				var filter = this.newFilterRep[key].testShip;
				if (!filter(ship))
					return false;
			}
			return true;
		},

		/* FILTERS
		Ship types, and other toggles
		---------------------------------*/
		showFilters :function(){
			var self = this;
			var sCtr;

			// Equip Stats: Yes
			self.options.equip_yes = $(".tab_ships .filters .massSelect .equip_yes").on("click", function(){
				self.equipMode = 1;
				self.refreshTable();
				self.options.equip_yes.addClass('on');
				self.options.equip_no.removeClass('on');
			});

			// Equip Stats: No
			self.options.equip_no = $(".tab_ships .filters .massSelect .equip_no").on("click", function(){
				self.equipMode = 0;
				self.refreshTable();
				self.options.equip_yes.removeClass('on');
				self.options.equip_no.addClass('on');
			});

			// Default status
			if( self.equipMode )
				self.options.equip_yes.addClass('on');
			else
				self.options.equip_no.addClass('on');

			// Column header sorting
			$(".tab_ships .ship_header .ship_field.hover").on("click", function(){
				var sorter = self.getLastCurrentSorter();
				var sorterName = $(this).data("type");
				if (sorterName === sorter.name) {
					self.reverseLastCurrentSorter();
				} else {
					if (self.multiKey) {
						// for multi index sorters
						self.pushToCurrentSorters( sorterName );
					} else {
						// for normal sorters
						self.setCurrentSorter( sorterName  );
					}
				}
				self.refreshTable();
			});

			this.refreshTable();
		},

		defineSorter: function(name,desc,comparator) {
			this.sorters[name] = {
				name: name,
				desc: desc,
				comparator: comparator
			};
		},

		defineSimpleSorter: function(name,desc,getter) {
			var self = this;
			this.defineSorter(
				name,desc,
				function(a,b) {
					var va = getter.call(self,a);
					var vb = getter.call(self,b);
					return va === vb
						 ? 0
						 : (va < vb) ? -1 : 1;
				});
		},

		prepareSorters: function() {
			var define = this.defineSimpleSorter.bind(this);

			define("id", "Id",
				   function(x) { return x.id; });
			define("name", "Name",
				   function(x) { return x.english; });
			define("type", "Type",
				   function(x) { return x.stype; });
			define("lv", "Level",
				   function(x) { return -x.level; });
			define("morale", "Morale",
				   function(x) { return -x.morale; });
			define("hp", "HP",
				   function(x) { return -x.hp; });
			define("fp", "Firepower",
				   function(x) { return -x.fp[this.equipMode+1]; });
			define("tp", "Torpedo",
				   function(x) { return -x.tp[this.equipMode+1]; });
			define("yasen", "Yasen",
				   function(x) { return -(x.fp[this.equipMode+1] + x.tp[this.equipMode+1]); });
			define("aa", "Anti-Air",
				   function(x) { return -x.aa[this.equipMode+1]; });
			define("ar", "Armor",
				   function(x) { return -x.ar[this.equipMode+1]; });
			define("as", "ASW",
				   function(x) { return -x.as[this.equipMode]; });
			define("ev", "Evasion",
				   function(x) { return -x.ev[this.equipMode]; });
			define("ls", "LoS",
				   function(x) { return -x.ls[this.equipMode]; });
			define("lk", "Luck",
				   function(x) { return -x.lk; });
		},

		/* REFRESH TABLE
		Reload ship list based on filters
		---------------------------------*/
		refreshTable :function(){
			// TODO: use "isLoading" to check if we need UI update.
			if(this.isLoading){ return false; }
			this.isLoading = true;

			var self = this;
			this.startTime = Date.now();

			// Clear list
			this.shipList.html("").hide();

			// Wait until execute
			setTimeout(function(){
				var shipCtr, cElm, cShip, shipLevel;

				// Filtering
				var FilteredShips = self.shipCache.filter(function(x) {
					return self.executeFilters(x);
				});

				// Sorting
				FilteredShips.sort( self.makeComparator() );

				// Fill up list
				Object.keys(FilteredShips).forEach(function(shipCtr){
					if(shipCtr%10 === 0){
						$("<div>").addClass("ingame_page").html("Page "+Math.ceil((Number(shipCtr)+1)/10)).appendTo(self.shipList);
					}

					cShip = FilteredShips[shipCtr];
					shipLevel = cShip.level;

					// we can save some time by avoiding constructing jquery object
					// if we already have one
					if (cShip.view) {
						cElm = cShip.view;
						cElm.appendTo(self.shipList);

						if (cElm.onRecompute)
							cElm.onRecompute(cShip);
						return;
					}

					cElm = $(".tab_ships .factory .ship_item").clone().appendTo(self.shipList);
					cShip.view = cElm;
					if(shipCtr%2 === 0){ cElm.addClass("even"); }else{ cElm.addClass("odd"); }

					$(".ship_id", cElm).text( cShip.id );
					$(".ship_img .ship_icon", cElm).attr("src", KC3Meta.shipIcon(cShip.bid));
					$(".ship_img .ship_icon", cElm).attr("alt", cShip.bid);
					$(".ship_name", cElm).text( cShip.english );
					if(shipLevel >= 100) {
						$(".ship_name", cElm).addClass("ship_kekkon-color");
					}
					if(cShip.fleet > 0) {
						$(".ship_name", cElm).addClass("ship_onfleet-color" + cShip.fleet);
					}
					$(".ship_type", cElm).text( KC3Meta.stype(cShip.stype) );
					var shipLevelConv = shipLevel;
					$(".ship_lv", cElm).html( "<span>Lv.</span>" + shipLevelConv);
					$(".ship_morale", cElm).html( cShip.morale );
					$(".ship_hp", cElm).text( cShip.hp );
					$(".ship_lk", cElm).text( cShip.lk );

					if(cShip.morale >= 50){ $(".ship_morale", cElm).addClass("sparkled"); }

					// callback for things that has to be recomputed
					cElm.onRecompute = function(ship) {
						var thisShip = ship || cShip;
						// Recomputes stats
						self.modernizableStat("fp", this, thisShip.fp);
						self.modernizableStat("tp", this, thisShip.tp);
						self.modernizableStat("yasen", this, thisShip.yasen);
						self.modernizableStat("aa", this, thisShip.aa);
						self.modernizableStat("ar", this, thisShip.ar);
						$(".ship_as", this).text( thisShip.as[self.equipMode] );
						$(".ship_ev", this).text( thisShip.ev[self.equipMode] );
						$(".ship_ls", this).text( thisShip.ls[self.equipMode] );
						// Rebind click handlers
						$(".ship_img .ship_icon", this).click(self.shipClickFunc);
						$(".ship_equip_icon img", this).click(self.gearClickFunc);
					};

					cElm.onRecompute(cShip);

					[1,2,3,4].forEach(function(x){
						self.equipImg(cElm, x, cShip.slots[x-1], cShip.equip[x-1]);
					});
					if(cShip.exSlot !== 0){
						self.equipImg(cElm, "ex", -2, cShip.exSlot);
					}

					if(FilteredShips[shipCtr].locked){ $(".ship_lock img", cElm).show(); }

					// Check whether remodel is max
					if( !cShip.remodel )
						cElm.addClass('remodel-max');
					else
						cElm.addClass('remodel-able');

					// Check whether modernization is max
					if( cShip.statmax )
						cElm.addClass('modernization-max');
					else
						cElm.addClass('modernization-able');
				});

				self.shipList.show();
				self.isLoading = false;
				console.log("Showing this list took", (Date.now() - self.startTime)-100 , "milliseconds");
			},100);
		},

		shipClickFunc: function(e){
			KC3StrategyTabs.gotoTab("mstship", $(this).attr("alt"));
		},

		gearClickFunc: function(e){
			KC3StrategyTabs.gotoTab("mstgear", $(this).attr("alt"));
		},

		/* Compute Derived Stats without Equipment
		--------------------------------------------*/
		getDerivedStatNaked :function(StatName, EquippedValue, ShipObj){
			var Items = ShipObj.equipment(true);
			for(var ctr in Items){
				if(Items[ctr].itemId > 0){
					EquippedValue -= Items[ctr].master()["api_"+StatName];
				}
			}
			return EquippedValue;
		},

		/* Show cell contents of a mod stat
		--------------------------------------------*/
		modernizableStat :function(stat, cElm, Values){
			$(".ship_"+stat, cElm).text( Values[this.equipMode+1] );
			if(Values[0] == Values[1]){
				$(".ship_"+stat, cElm).addClass("max");
			}else{
				$(".ship_"+stat, cElm).append("<span>+"+(Values[0] - Values[1])+"</span>");
			}
		},

		/* Show single equipment icon
		--------------------------------------------*/
		equipImg :function(cElm, equipNum, equipSlot, gearId){
			var element = $(".ship_equip_" + equipNum, cElm);
			if(gearId > 0){
				var gear = KC3GearManager.get(gearId);
				if(gear.itemId<=0){ element.hide(); return; }

				$("img",element)
					.attr("src", "../../assets/img/items/" + gear.master().api_type[3] + ".png")
					.attr("title", gear.name())
					.attr("alt", gear.master().api_id)
					.show();
				$("span",element).css('visibility','hidden');
			} else {
				$("img",element).hide();
				$("span",element).each(function(i,x){
					if(equipSlot > 0)
						$(x).text(equipSlot);
					else if(equipSlot === -2)
						// for ex slot opened, but not equipped
						$(x).addClass("empty");
					else
						$(x).css('visibility','hidden');
				});
			}
		}
	};

})();

redpajama_set_name: RedPajamaGithub