Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBShaderObjects

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Native bindings to the ARB_shader_objects extension.

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.0.

Field Summary

Modifier and TypeField and Description
public static final int
GL_BOOL_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_BOOL_VEC2_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_BOOL_VEC3_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_BOOL_VEC4_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_FLOAT_MAT2_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_FLOAT_MAT3_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_FLOAT_MAT4_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_FLOAT_VEC2_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_FLOAT_VEC3_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_FLOAT_VEC4_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_INT_VEC2_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_INT_VEC3_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_INT_VEC4_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_ACTIVE_UNIFORMS_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_ATTACHED_OBJECTS_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_COMPILE_STATUS_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_DELETE_STATUS_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_INFO_LOG_LENGTH_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_SHADER_SOURCE_LENGTH_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_SUBTYPE_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_TYPE_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_OBJECT_VALIDATE_STATUS_ARB

Accepted by the pname parameter of GetObjectParameter{fi}vARB.

public static final int
GL_PROGRAM_OBJECT_ARB

Accepted by the pname argument of GetHandleARB.

public static final int
GL_SAMPLER_1D_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_SAMPLER_1D_SHADOW_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_SAMPLER_2D_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_SAMPLER_2D_RECT_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_SAMPLER_2D_RECT_SHADOW_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_SAMPLER_2D_SHADOW_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_SAMPLER_3D_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_SAMPLER_CUBE_ARB

Returned by the type parameter of GetActiveUniformARB.

public static final int
GL_SHADER_OBJECT_ARB

Returned by the params parameter of GetObjectParameter{fi}vARB.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod 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
glCompileShaderARB(int
the shader object to compile
shaderObj
)

Compiles a shader object.

public static native int
glCreateProgramObjectARB()

Creates a program object.

public static native int
glCreateShaderObjectARB(int
the type of the shader object to be created. One of:
VERTEX_SHADER_ARBFRAGMENT_SHADER_ARB
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 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.
programObj
,
int
the uniform index
index
,
IntBuffer
a buffer in which to return the actual number of characters written by the GL into name. This count excludes the null termination. If length is NULL then the GL ignores this parameter.
length
,
IntBuffer
a buffer in which to return the uniform size. The size is in units of the type returned in type.
size
,
IntBuffer
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 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.
programObj
,
int
the uniform index
index
,
int
the maximum number of characters the GL is allowed to write into name.
maxLength
,
IntBuffer
a buffer in which to return the uniform size. The size is in units of the type returned in type.
size
,
IntBuffer
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 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.
programObj
,
int
the uniform index
index
,
IntBuffer
a buffer in which to return the uniform size. The size is in units of the type returned in type.
size
,
IntBuffer
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: GetActiveUniformARB

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 obj. If NULL then the GL ignores this parameter.
count
,
IntBuffer
a buffer in which to return the attached object handles
obj
)

Returns the handles of objects attached to containerObj in obj.

public static void
glGetAttachedObjectsARB(int containerObj, int[] count, int[] obj)

Array version of: GetAttachedObjectsARB

public static native int
glGetHandleARB(int
the state item for which the current object is to be returned. Must be:
PROGRAM_OBJECT_ARB
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 infoLog is returned in length, excluding the null termination. If length is NULL then the GL ignores this parameter.
length
,
ByteBuffer
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 infoLog
maxLength
)

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
)

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
glGetInfoLogARB(int obj, int[] length, ByteBuffer infoLog)

Array version of: GetInfoLogARB

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: GetObjectParameterfvARB

public static int
public static void
public static void
glGetObjectParameterivARB(int obj, int pname, int[] params)

Array version of: GetObjectParameterivARB

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 source, excluding the null termination. If length is NULL then the GL ignores this parameter.
length
,
ByteBuffer
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 source
maxLength
)

Returns 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
glGetShaderSourceARB(int obj, int[] length, ByteBuffer source)

Array version of: GetShaderSourceARB

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
glGetUniformfvARB(int programObj, int location, float[] params)

Array version of: GetUniformfvARB

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
glGetUniformivARB(int programObj, int location, int[] params)

Array version of: GetUniformivARB

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 name.

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 name.

public static native void
glLinkProgramARB(int
the program object to link
programObj
)

Links a program object.

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 is set to NULL, all strings in the string argument are considered null terminated.
length
)

Sets the source code for the specified shader object shaderObj to the text strings in the string array.

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 shaderObj to the text strings in the string array.

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 shaderObj to the text strings in the string array.

public static void
glShaderSourceARB(int shaderObj, PointerBuffer string, int[] length)

Array version of: ShaderSourceARB

public static native void
glUniform1fARB(int
the uniform variable location
location
,
float
the uniform x value
v0
)

float version of Uniform4fARB.

public static void
glUniform1fvARB(int
the uniform variable location
location
,
FloatBuffer
the values to load
value
)

Loads floating-point values count times into a uniform location defined as an array of float values.

public static void
glUniform1fvARB(int location, float[] value)

Array version of: Uniform1fvARB

public static native void
glUniform1iARB(int
the uniform variable location
location
,
int
the uniform x value
v0
)

int version of Uniform1fARB.

public static void
glUniform1ivARB(int
the uniform variable location
location
,
IntBuffer
the values to load
value
)

Loads integer values count times into a uniform location defined as an array of integer values.

public static void
glUniform1ivARB(int location, int[] value)

Array version of: Uniform1ivARB

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 Uniform4fARB.

public static void
glUniform2fvARB(int
the uniform variable location
location
,
FloatBuffer
the values to load
value
)

Loads floating-point values count times into a uniform location defined as an array of vec2 vectors.

public static void
glUniform2fvARB(int location, float[] value)

Array version of: Uniform2fvARB

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 Uniform2fARB.

public static void
glUniform2ivARB(int
the uniform variable location
location
,
IntBuffer
the values to load
value
)

Loads integer values count times into a uniform location defined as an array of ivec2 vectors.

public static void
glUniform2ivARB(int location, int[] value)

Array version of: Uniform2ivARB

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 Uniform4fARB.

public static void
glUniform3fvARB(int
the uniform variable location
location
,
FloatBuffer
the values to load
value
)

Loads floating-point values count times into a uniform location defined as an array of vec3 vectors.

public static void
glUniform3fvARB(int location, float[] value)

Array version of: Uniform3fvARB

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 Uniform3fARB.

public static void
glUniform3ivARB(int
the uniform variable location
location
,
IntBuffer
the values to load
value
)

Loads integer values count times into a uniform location defined as an array of ivec3 vectors.

public static void
glUniform3ivARB(int location, int[] value)

Array version of: Uniform3ivARB

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 count times into a uniform location defined as an array of vec4 vectors.

public static void
glUniform4fvARB(int location, float[] value)

Array version of: Uniform4fvARB

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 Uniform4fARB.

public static void
glUniform4ivARB(int
the uniform variable location
location
,
IntBuffer
the values to load
value
)

Loads integer values count times into a uniform location defined as an array of ivec4 vectors.

public static void
glUniform4ivARB(int location, int[] value)

Array version of: Uniform4ivARB

public static void
glUniformMatrix2fvARB(int
the uniform variable location
location
,
boolean
if FALSE, the matrix is specified in column major order, otherwise in row major order
transpose
,
FloatBuffer
the matrix values to load
value
)

Loads a 2x2 matrix of floating-point values count times into a uniform location defined as a matrix or an array of matrices.

public static void
glUniformMatrix2fvARB(int location, boolean transpose, float[] value)

Array version of: UniformMatrix2fvARB

public static void
glUniformMatrix3fvARB(int
the uniform variable location
location
,
boolean
if FALSE, the matrix is specified in column major order, otherwise in row major order
transpose
,
FloatBuffer
the matrix values to load
value
)

Loads a 3x3 matrix of floating-point values count times into a uniform location defined as a matrix or an array of matrices.

public static void
glUniformMatrix3fvARB(int location, boolean transpose, float[] value)

Array version of: UniformMatrix3fvARB

public static void
glUniformMatrix4fvARB(int
the uniform variable location
location
,
boolean
if FALSE, the matrix is specified in column major order, otherwise in row major order
transpose
,
FloatBuffer
the matrix values to load
value
)

Loads a 4x4 matrix of floating-point values count times into a uniform location defined as a matrix or an array of matrices.

public static void
glUniformMatrix4fvARB(int location, boolean transpose, float[] value)

Array version of: UniformMatrix4fvARB

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 programObj contains valid executable code, i.e. has been linked successfully.

public static native void
glValidateProgramARB(int
the program object to validate
programObj
)

Validates the program object programObj against the GL state at that moment.

public static native void
nglGetActiveUniformARB(int programObj, int index, int
the maximum number of characters the GL is allowed to write into name.
maxLength
,
long length, long size, long type, long name)

Unsafe version of: GetActiveUniformARB

public static native void
nglGetAttachedObjectsARB(int containerObj, int
the maximum number of handles the GL is allowed to write into obj
maxCount
,
long count, long obj)

Unsafe version of: GetAttachedObjectsARB

public static native void
nglGetInfoLogARB(int obj, int
the maximum number of characters the GL is allowed to write into infoLog
maxLength
,
long length, long infoLog)

Unsafe version of: GetInfoLogARB

public static native void
nglGetObjectParameterfvARB(int obj, int pname, long params)

Unsafe version of: GetObjectParameterfvARB

public static native void
nglGetObjectParameterivARB(int obj, int pname, long params)

Unsafe version of: GetObjectParameterivARB

public static native void
nglGetShaderSourceARB(int obj, int
the maximum number of characters the GL is allowed to write into source
maxLength
,
long length, long source)

Unsafe version of: GetShaderSourceARB

public static native void
nglGetUniformfvARB(int programObj, int location, long params)

Unsafe version of: GetUniformfvARB

public static native void
nglGetUniformivARB(int programObj, int location, long params)

Unsafe version of: GetUniformivARB

public static native int
nglGetUniformLocationARB(int programObj, long name)

Unsafe version of: GetUniformLocationARB

public static native void
nglShaderSourceARB(int shaderObj, int
the number of strings in the array
count
,
long string, long length)

Unsafe version of: ShaderSourceARB

public static native void
nglUniform1fvARB(int location, int
the number of float values to load
count
,
long value)

Unsafe version of: Uniform1fvARB

public static native void
nglUniform1ivARB(int location, int
the number of integer values to load
count
,
long value)

Unsafe version of: Uniform1ivARB

public static native void
nglUniform2fvARB(int location, int
the number of vec2 vectors to load
count
,
long value)

Unsafe version of: Uniform2fvARB

public static native void
nglUniform2ivARB(int location, int
the number of ivec2 vectors to load
count
,
long value)

Unsafe version of: Uniform2ivARB

public static native void
nglUniform3fvARB(int location, int
the number of vec3 vectors to load
count
,
long value)

Unsafe version of: Uniform3fvARB

public static native void
nglUniform3ivARB(int location, int
the number of ivec3 vectors to load
count
,
long value)

Unsafe version of: Uniform3ivARB

public static native void
nglUniform4fvARB(int location, int
the number of vec4 vectors to load
count
,
long value)

Unsafe version of: Uniform4fvARB

public static native void
nglUniform4ivARB(int location, int
the number of ivec4 vectors to load
count
,
long value)

Unsafe version of: Uniform4ivARB

public static native void
nglUniformMatrix2fvARB(int location, int
the number of 2x2 matrices to load
count
,
boolean transpose, long value)

Unsafe version of: UniformMatrix2fvARB

public static native void
nglUniformMatrix3fvARB(int location, int
the number of 3x3 matrices to load
count
,
boolean transpose, long value)

Unsafe version of: UniformMatrix3fvARB

public static native void
nglUniformMatrix4fvARB(int location, int
the number of 4x4 matrices to load
count
,
boolean transpose, long value)

Unsafe version of: UniformMatrix4fvARB

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait