This extension adds API calls that are necessary to manage shader objects and program objects as defined in the OpenGL 2.0 white papers by 3Dlabs.
The generation of an executable that runs on one of OpenGL's programmable units is modeled to that of developing a typical C/C++ application. There are one or more source files, each of which are stored by OpenGL in a shader object. Each shader object (source file) needs to be compiled and attached to a program object. Once all shader objects are compiled successfully, the program object needs to be linked to produce an executable. This executable is part of the program object, and can now be loaded onto the programmable units to make it part of the current OpenGL state. Both the compile and link stages generate a text string that can be queried to get more information. This information could be, but is not limited to, compile errors, link errors, optimization hints, etc. Values for uniform variables, declared in a shader, can be set by the application and used to control a shader's behavior.
This extension defines functions for creating shader objects and program objects, for compiling shader objects, for linking program objects, for attaching shader objects to program objects, and for using a program object as part of current state. Functions to load uniform values are also defined. Some house keeping functions, like deleting an object and querying object state, are also provided.
Although this extension defines the API for creating shader objects, it does not define any specific types of shader objects. It is assumed that this
extension will be implemented along with at least one such additional extension for creating a specific type of OpenGL 2.0 shader (e.g., the
ARB_fragment_shader extension or the ARB_vertex_shader extension).
Promoted to core in OpenGL 2..
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_BOOL_ARB
Returned by the |
| public static final int | GL_BOOL_VEC2_ARB
Returned by the |
| public static final int | GL_BOOL_VEC3_ARB
Returned by the |
| public static final int | GL_BOOL_VEC4_ARB
Returned by the |
| public static final int | GL_FLOAT_MAT2_ARB
Returned by the |
| public static final int | GL_FLOAT_MAT3_ARB
Returned by the |
| public static final int | GL_FLOAT_MAT4_ARB
Returned by the |
| public static final int | GL_FLOAT_VEC2_ARB
Returned by the |
| public static final int | GL_FLOAT_VEC3_ARB
Returned by the |
| public static final int | GL_FLOAT_VEC4_ARB
Returned by the |
| public static final int | GL_INT_VEC2_ARB
Returned by the |
| public static final int | GL_INT_VEC3_ARB
Returned by the |
| public static final int | GL_INT_VEC4_ARB
Returned by the |
| public static final int | GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB
Accepted by the |
| public static final int | GL_OBJECT_ACTIVE_UNIFORMS_ARB
Accepted by the |
| public static final int | GL_OBJECT_ATTACHED_OBJECTS_ARB
Accepted by the |
| public static final int | GL_OBJECT_COMPILE_STATUS_ARB
Accepted by the |
| public static final int | GL_OBJECT_DELETE_STATUS_ARB
Accepted by the |
| public static final int | GL_OBJECT_INFO_LOG_LENGTH_ARB
Accepted by the |
| public static final int | GL_OBJECT_LINK_STATUS_ARB
Accepted by the |
| public static final int | GL_OBJECT_SHADER_SOURCE_LENGTH_ARB
Accepted by the |
| public static final int | GL_OBJECT_SUBTYPE_ARB
Accepted by the |
| public static final int | GL_OBJECT_TYPE_ARB
Accepted by the |
| public static final int | GL_OBJECT_VALIDATE_STATUS_ARB
Accepted by the |
| public static final int | GL_PROGRAM_OBJECT_ARB
Accepted by the |
| public static final int | GL_SAMPLER_1D_ARB
Returned by the |
| public static final int | GL_SAMPLER_1D_SHADOW_ARB
Returned by the |
| public static final int | GL_SAMPLER_2D_ARB
Returned by the |
| public static final int | GL_SAMPLER_2D_RECT_ARB
Returned by the |
| public static final int | GL_SAMPLER_2D_RECT_SHADOW_ARB
Returned by the |
| public static final int | GL_SAMPLER_2D_SHADOW_ARB
Returned by the |
| public static final int | GL_SAMPLER_3D_ARB
Returned by the |
| public static final int | GL_SAMPLER_CUBE_ARB
Returned by the |
| public static final int | GL_SHADER_OBJECT_ARB
Returned by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | ||
|---|---|---|---|
| public static native void | glAttachObjectARB(int
the container object containerObj, int the object to attach obj)Attaches an object to a container object. | ||
| public static native void | |||
| public static native int | |||
| public static native int | glCreateShaderObjectARB(int
the type of the shader object to be created. One of: shaderType)
Creates a shader object. | ||
| public static native void | glDeleteObjectARB(int
the shader object to delete obj)Either deletes the object, or flags it for deletion. | ||
| public static native void | glDetachObjectARB(int
the container object containerObj, int the object to detach attachedObj)Detaches an object from the container object it is attached to. | ||
| public static void | glGetActiveUniformARB(int
a handle to a program object for which the command programObj, int LinkProgramARB has been issued in the past. It is not necessary for programObj to have
been linked successfully. The link could have failed because the number of active uniforms exceeded the limit.the uniform index index, IntBuffer a buffer in which to return the actual number of characters written by the GL into length, IntBuffer name. This count excludes the null termination. If
length is NULL then the GL ignores this parameter.a buffer in which to return the uniform size. The size is in units of the type returned in size, IntBuffer type.a buffer in which to return the uniform type type, ByteBuffer a buffer in which to return the uniform name name)Determines which of the declared uniform variables are active and their sizes and types. | ||
| public static String | glGetActiveUniformARB(int
a handle to a program object for which the command programObj, int LinkProgramARB has been issued in the past. It is not necessary for programObj to have
been linked successfully. The link could have failed because the number of active uniforms exceeded the limit.the uniform index index, int the maximum number of characters the GL is allowed to write into maxLength, IntBuffer name.a buffer in which to return the uniform size. The size is in units of the type returned in size, IntBuffer type.a buffer in which to return the uniform type type)Determines which of the declared uniform variables are active and their sizes and types. | ||
| public static String | glGetActiveUniformARB(int
a handle to a program object for which the command programObj, int LinkProgramARB has been issued in the past. It is not necessary for programObj to have
been linked successfully. The link could have failed because the number of active uniforms exceeded the limit.the uniform index index, IntBuffer a buffer in which to return the uniform size. The size is in units of the type returned in size, IntBuffer type.a buffer in which to return the uniform type type)Determines which of the declared uniform variables are active and their sizes and types. | ||
| public static void | glGetActiveUniformARB(int programObj, int index, int[] length, int[] size, int[] type, ByteBuffer name)
Array version of: | ||
| public static void | glGetAttachedObjectsARB(int
the container object to query containerObj, IntBuffer a buffer in which to return the actual number of object handles written by the GL into count, IntBuffer obj. If NULL then the GL ignores this parameter.a buffer in which to return the attached object handles obj)Returns the handles of objects attached to | ||
| public static void | glGetAttachedObjectsARB(int containerObj, int[] count, int[] obj)
Array version of: | ||
| public static native int | glGetHandleARB(int
the state item for which the current object is to be returned. Must be: pname)
Returns the handle to an object that is in use as part of current state. | ||
| public static void | glGetInfoLogARB(int
the shader object to query obj, IntBuffer the actual number of characters written by the GL into length, ByteBuffer infoLog is returned in length, excluding the null termination. If
length is NULL then the GL ignores this parameter.a buffer in which to return the info log infoLog)A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. | ||
| public static String | glGetInfoLogARB(int
the shader object to query obj, int the maximum number of characters the GL is allowed to write into maxLength)infoLogA string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. | ||
| public static String | glGetInfoLogARB(int
the shader object to query obj)A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. | ||
| public static void | |||
| public static void | glGetObjectParameterfvARB(int
the object to query obj, int the parameter to query pname, FloatBuffer a buffer in which to return the parameter value params)Returns object specific parameter values. | ||
| public static void | glGetObjectParameterfvARB(int obj, int pname, float[] params)
Array version of: | ||
| public static int | glGetObjectParameteriARB(int
the object to query obj, int the parameter to query. One of: pname)Returns object specific parameter values. | ||
| public static void | glGetObjectParameterivARB(int
the object to query obj, int the parameter to query. One of: pname, IntBuffer a buffer in which to return the parameter value params)Returns object specific parameter values. | ||
| public static void | glGetObjectParameterivARB(int obj, int pname, int[] params)
Array version of: | ||
| public static void | glGetShaderSourceARB(int
the shader object to query obj, IntBuffer a buffer in which to return the actual number of characters written by the GL into length, ByteBuffer source, excluding the null termination. If
length is NULL then the GL ignores this parameter.a buffer in which to return the shader object source source)Returns the string making up the source code for a shader object. | ||
| public static String | glGetShaderSourceARB(int
the shader object to query obj, int the maximum number of characters the GL is allowed to write into maxLength)sourceReturns the string making up the source code for a shader object. | ||
| public static String | glGetShaderSourceARB(int
the shader object to query obj)Returns the string making up the source code for a shader object. | ||
| public static void | |||
| public static float | glGetUniformfARB(int
the program object to query programObj, int the uniform variable location location)Returns the floating-point value or values of a uniform. | ||
| public static void | glGetUniformfvARB(int
the program object to query programObj, int the uniform variable location location, FloatBuffer a buffer in which to return the uniform values params)Returns the floating-point value or values of a uniform. | ||
| public static void | |||
| public static int | glGetUniformiARB(int
the program object to query programObj, int the uniform variable location location)Returns the integer value or values of a uniform. | ||
| public static void | glGetUniformivARB(int
the program object to query programObj, int the uniform variable location location, IntBuffer a buffer in which to return the uniform values params)Returns the integer value or values of a uniform. | ||
| public static void | |||
| public static int | glGetUniformLocationARB(int
the program object to query programObj, ByteBuffer the name of the uniform variable whose location is to be queried name)Returns the location of uniform variable | ||
| public static int | glGetUniformLocationARB(int
the program object to query programObj, CharSequence the name of the uniform variable whose location is to be queried name)Returns the location of uniform variable | ||
| public static native void | |||
| public static void | glShaderSourceARB(int
the shader object shaderObj, PointerBuffer an array of pointers to one or more, optionally null terminated, character strings that make up the source code string, IntBuffer an array with the number of charARBs in each string (the string length). Each element in this array can be set to negative one (or smaller),
indicating that its accompanying string is null terminated. If length)length is set to NULL, all strings in the string argument are
considered null terminated.Sets the source code for the specified shader object | ||
| public static void | glShaderSourceARB(int
the shader object shaderObj, CharSequence... an array of pointers to one or more, optionally null terminated, character strings that make up the source code string)Sets the source code for the specified shader object | ||
| public static void | glShaderSourceARB(int
the shader object shaderObj, CharSequence an array of pointers to one or more, optionally null terminated, character strings that make up the source code string)Sets the source code for the specified shader object | ||
| public static void | glShaderSourceARB(int shaderObj, PointerBuffer string, int[] length)
Array version of: | ||
| public static native void | glUniform1fARB(int
the uniform variable location location, float the uniform x value v0)float version of | ||
| public static void | glUniform1fvARB(int
the uniform variable location location, FloatBuffer the values to load value)Loads floating-point values | ||
| public static void | |||
| public static native void | glUniform1iARB(int
the uniform variable location location, int the uniform x value v0)int version of | ||
| public static void | glUniform1ivARB(int
the uniform variable location location, IntBuffer the values to load value)Loads integer values | ||
| public static void | |||
| public static native void | glUniform2fARB(int
the uniform variable location location, float the uniform x value v0, float the uniform y value v1)vec2 version of | ||
| public static void | glUniform2fvARB(int
the uniform variable location location, FloatBuffer the values to load value)Loads floating-point values | ||
| public static void | |||
| public static native void | glUniform2iARB(int
the uniform variable location location, int the uniform x value v0, int the uniform y value v1)ivec2 version of | ||
| public static void | glUniform2ivARB(int
the uniform variable location location, IntBuffer the values to load value)Loads integer values | ||
| public static void | |||
| public static native void | glUniform3fARB(int
the uniform variable location location, float the uniform x value v0, float the uniform y value v1, float the uniform z value v2)vec3 version of | ||
| public static void | glUniform3fvARB(int
the uniform variable location location, FloatBuffer the values to load value)Loads floating-point values | ||
| public static void | |||
| public static native void | glUniform3iARB(int
the uniform variable location location, int the uniform x value v0, int the uniform y value v1, int the uniform z value v2)ivec3 version of | ||
| public static void | glUniform3ivARB(int
the uniform variable location location, IntBuffer the values to load value)Loads integer values | ||
| public static void | |||
| public static native void | glUniform4fARB(int
the uniform variable location location, float the uniform x value v0, float the uniform y value v1, float the uniform z value v2, float the uniform w value v3)Loads a vec4 value into a uniform variable of the program object that is currently in use. | ||
| public static void | glUniform4fvARB(int
the uniform variable location location, FloatBuffer the values to load value)Loads floating-point values | ||
| public static void | |||
| public static native void | glUniform4iARB(int
the uniform variable location location, int the uniform x value v0, int the uniform y value v1, int the uniform z value v2, int the uniform w value v3)ivec4 version of | ||
| public static void | glUniform4ivARB(int
the uniform variable location location, IntBuffer the values to load value)Loads integer values | ||
| public static void | |||
| public static void | glUniformMatrix2fvARB(int
the uniform variable location location, boolean if transpose, FloatBuffer FALSE, the matrix is specified in column major order, otherwise in row major orderthe matrix values to load value)Loads a 2x2 matrix of floating-point values | ||
| public static void | glUniformMatrix2fvARB(int location, boolean transpose, float[] value)
Array version of: | ||
| public static void | glUniformMatrix3fvARB(int
the uniform variable location location, boolean if transpose, FloatBuffer FALSE, the matrix is specified in column major order, otherwise in row major orderthe matrix values to load value)Loads a 3x3 matrix of floating-point values | ||
| public static void | glUniformMatrix3fvARB(int location, boolean transpose, float[] value)
Array version of: | ||
| public static void | glUniformMatrix4fvARB(int
the uniform variable location location, boolean if transpose, FloatBuffer FALSE, the matrix is specified in column major order, otherwise in row major orderthe matrix values to load value)Loads a 4x4 matrix of floating-point values | ||
| public static void | glUniformMatrix4fvARB(int location, boolean transpose, float[] value)
Array version of: | ||
| public static native void | glUseProgramObjectARB(int
the program object to use programObj)Installs the executable code as part of current rendering state if the program object | ||
| public static native void | glValidateProgramARB(int
the program object to validate programObj)Validates the program object | ||
| public static native void | nglGetActiveUniformARB(int programObj, int index, int
the maximum number of characters the GL is allowed to write into maxLength, long length, long size, long type, long name)name.Unsafe version of: | ||
| public static native void | nglGetAttachedObjectsARB(int containerObj, int
the maximum number of handles the GL is allowed to write into maxCount, long count, long obj)objUnsafe version of: | ||
| public static native void | nglGetInfoLogARB(int obj, int
the maximum number of characters the GL is allowed to write into maxLength, long length, long infoLog)infoLogUnsafe version of: | ||
| public static native void | nglGetObjectParameterfvARB(int obj, int pname, long params)
Unsafe version of: | ||
| public static native void | nglGetObjectParameterivARB(int obj, int pname, long params)
Unsafe version of: | ||
| public static native void | nglGetShaderSourceARB(int obj, int
the maximum number of characters the GL is allowed to write into maxLength, long length, long source)sourceUnsafe version of: | ||
| public static native void | |||
| public static native void | |||
| public static native int | |||
| public static native void | nglShaderSourceARB(int shaderObj, int
the number of strings in the array count, long string, long length)Unsafe version of: | ||
| public static native void | nglUniform1fvARB(int location, int
the number of float values to load count, long value)Unsafe version of: | ||
| public static native void | nglUniform1ivARB(int location, int
the number of integer values to load count, long value)Unsafe version of: | ||
| public static native void | nglUniform2fvARB(int location, int
the number of vec2 vectors to load count, long value)Unsafe version of: | ||
| public static native void | nglUniform2ivARB(int location, int
the number of ivec2 vectors to load count, long value)Unsafe version of: | ||
| public static native void | nglUniform3fvARB(int location, int
the number of vec3 vectors to load count, long value)Unsafe version of: | ||
| public static native void | nglUniform3ivARB(int location, int
the number of ivec3 vectors to load count, long value)Unsafe version of: | ||
| public static native void | nglUniform4fvARB(int location, int
the number of vec4 vectors to load count, long value)Unsafe version of: | ||
| public static native void | nglUniform4ivARB(int location, int
the number of ivec4 vectors to load count, long value)Unsafe version of: | ||
| public static native void | nglUniformMatrix2fvARB(int location, int
the number of 2x2 matrices to load count, boolean transpose, long value)Unsafe version of: | ||
| public static native void | nglUniformMatrix3fvARB(int location, int
the number of 3x3 matrices to load count, boolean transpose, long value)Unsafe version of: | ||
| public static native void | nglUniformMatrix4fvARB(int location, int
the number of 4x4 matrices to load count, boolean transpose, long value)Unsafe version of: |