Class ARBShaderObjects
- java.lang.Object
-
- org.lwjgl.opengl.ARBShaderObjects
-
public class ARBShaderObjects extends java.lang.Object
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 theARB_vertex_shader
extension).Promoted to core in
OpenGL 2.0
.
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
glAttachObjectARB(int containerObj, int obj)
Attaches an object to a container object.static void
glCompileShaderARB(int shaderObj)
Compiles a shader object.static int
glCreateProgramObjectARB()
Creates a program object.static int
glCreateShaderObjectARB(int shaderType)
Creates a shader object.static void
glDeleteObjectARB(int obj)
Either deletes the object, or flags it for deletion.static void
glDetachObjectARB(int containerObj, int attachedObj)
Detaches an object from the container object it is attached to.static void
glGetActiveUniformARB(int programObj, int index, int[] length, int[] size, int[] type, java.nio.ByteBuffer name)
Array version of:GetActiveUniformARB
static java.lang.String
glGetActiveUniformARB(int programObj, int index, java.nio.IntBuffer size, java.nio.IntBuffer type)
Determines which of the declared uniform variables are active and their sizes and types.static void
glGetActiveUniformARB(int programObj, int index, java.nio.IntBuffer length, java.nio.IntBuffer size, java.nio.IntBuffer type, java.nio.ByteBuffer name)
Determines which of the declared uniform variables are active and their sizes and types.static java.lang.String
glGetActiveUniformARB(int programObj, int index, int maxLength, java.nio.IntBuffer size, java.nio.IntBuffer type)
Determines which of the declared uniform variables are active and their sizes and types.static void
glGetAttachedObjectsARB(int containerObj, int[] count, int[] obj)
Array version of:GetAttachedObjectsARB
static void
glGetAttachedObjectsARB(int containerObj, java.nio.IntBuffer count, java.nio.IntBuffer obj)
Returns the handles of objects attached tocontainerObj
inobj
.static int
glGetHandleARB(int pname)
Returns the handle to an object that is in use as part of current state.static java.lang.String
glGetInfoLogARB(int obj)
A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object.static java.lang.String
glGetInfoLogARB(int obj, int maxLength)
A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object.static void
glGetInfoLogARB(int obj, int[] length, java.nio.ByteBuffer infoLog)
Array version of:GetInfoLogARB
static void
glGetInfoLogARB(int obj, java.nio.IntBuffer length, java.nio.ByteBuffer infoLog)
A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object.static void
glGetObjectParameterfvARB(int obj, int pname, float[] params)
Array version of:GetObjectParameterfvARB
static void
glGetObjectParameterfvARB(int obj, int pname, java.nio.FloatBuffer params)
Returns object specific parameter values.static int
glGetObjectParameteriARB(int obj, int pname)
Returns object specific parameter values.static void
glGetObjectParameterivARB(int obj, int pname, int[] params)
Array version of:GetObjectParameterivARB
static void
glGetObjectParameterivARB(int obj, int pname, java.nio.IntBuffer params)
Returns object specific parameter values.static java.lang.String
glGetShaderSourceARB(int obj)
Returns the string making up the source code for a shader object.static java.lang.String
glGetShaderSourceARB(int obj, int maxLength)
Returns the string making up the source code for a shader object.static void
glGetShaderSourceARB(int obj, int[] length, java.nio.ByteBuffer source)
Array version of:GetShaderSourceARB
static void
glGetShaderSourceARB(int obj, java.nio.IntBuffer length, java.nio.ByteBuffer source)
Returns the string making up the source code for a shader object.static float
glGetUniformfARB(int programObj, int location)
Returns the floating-point value or values of a uniform.static void
glGetUniformfvARB(int programObj, int location, float[] params)
Array version of:GetUniformfvARB
static void
glGetUniformfvARB(int programObj, int location, java.nio.FloatBuffer params)
Returns the floating-point value or values of a uniform.static int
glGetUniformiARB(int programObj, int location)
Returns the integer value or values of a uniform.static void
glGetUniformivARB(int programObj, int location, int[] params)
Array version of:GetUniformivARB
static void
glGetUniformivARB(int programObj, int location, java.nio.IntBuffer params)
Returns the integer value or values of a uniform.static int
glGetUniformLocationARB(int programObj, java.nio.ByteBuffer name)
Returns the location of uniform variablename
.static int
glGetUniformLocationARB(int programObj, java.lang.CharSequence name)
Returns the location of uniform variablename
.static void
glLinkProgramARB(int programObj)
Links a program object.static void
glShaderSourceARB(int shaderObj, java.lang.CharSequence... string)
Sets the source code for the specified shader objectshaderObj
to the text strings in thestring
array.static void
glShaderSourceARB(int shaderObj, java.lang.CharSequence string)
Sets the source code for the specified shader objectshaderObj
to the text strings in thestring
array.static void
glShaderSourceARB(int shaderObj, org.lwjgl.PointerBuffer string, int[] length)
Array version of:ShaderSourceARB
static void
glShaderSourceARB(int shaderObj, org.lwjgl.PointerBuffer string, java.nio.IntBuffer length)
Sets the source code for the specified shader objectshaderObj
to the text strings in thestring
array.static void
glUniform1fARB(int location, float v0)
float version ofUniform4fARB
.static void
glUniform1fvARB(int location, float[] value)
Array version of:Uniform1fvARB
static void
glUniform1fvARB(int location, java.nio.FloatBuffer value)
Loads floating-point valuescount
times into a uniform location defined as an array of float values.static void
glUniform1iARB(int location, int v0)
int version ofUniform1fARB
.static void
glUniform1ivARB(int location, int[] value)
Array version of:Uniform1ivARB
static void
glUniform1ivARB(int location, java.nio.IntBuffer value)
Loads integer valuescount
times into a uniform location defined as an array of integer values.static void
glUniform2fARB(int location, float v0, float v1)
vec2 version ofUniform4fARB
.static void
glUniform2fvARB(int location, float[] value)
Array version of:Uniform2fvARB
static void
glUniform2fvARB(int location, java.nio.FloatBuffer value)
Loads floating-point valuescount
times into a uniform location defined as an array of vec2 vectors.static void
glUniform2iARB(int location, int v0, int v1)
ivec2 version ofUniform2fARB
.static void
glUniform2ivARB(int location, int[] value)
Array version of:Uniform2ivARB
static void
glUniform2ivARB(int location, java.nio.IntBuffer value)
Loads integer valuescount
times into a uniform location defined as an array of ivec2 vectors.static void
glUniform3fARB(int location, float v0, float v1, float v2)
vec3 version ofUniform4fARB
.static void
glUniform3fvARB(int location, float[] value)
Array version of:Uniform3fvARB
static void
glUniform3fvARB(int location, java.nio.FloatBuffer value)
Loads floating-point valuescount
times into a uniform location defined as an array of vec3 vectors.static void
glUniform3iARB(int location, int v0, int v1, int v2)
ivec3 version ofUniform3fARB
.static void
glUniform3ivARB(int location, int[] value)
Array version of:Uniform3ivARB
static void
glUniform3ivARB(int location, java.nio.IntBuffer value)
Loads integer valuescount
times into a uniform location defined as an array of ivec3 vectors.static void
glUniform4fARB(int location, float v0, float v1, float v2, float v3)
Loads a vec4 value into a uniform variable of the program object that is currently in use.static void
glUniform4fvARB(int location, float[] value)
Array version of:Uniform4fvARB
static void
glUniform4fvARB(int location, java.nio.FloatBuffer value)
Loads floating-point valuescount
times into a uniform location defined as an array of vec4 vectors.static void
glUniform4iARB(int location, int v0, int v1, int v2, int v3)
ivec4 version ofUniform4fARB
.static void
glUniform4ivARB(int location, int[] value)
Array version of:Uniform4ivARB
static void
glUniform4ivARB(int location, java.nio.IntBuffer value)
Loads integer valuescount
times into a uniform location defined as an array of ivec4 vectors.static void
glUniformMatrix2fvARB(int location, boolean transpose, float[] value)
Array version of:UniformMatrix2fvARB
static void
glUniformMatrix2fvARB(int location, boolean transpose, java.nio.FloatBuffer value)
Loads a 2x2 matrix of floating-point valuescount
times into a uniform location defined as a matrix or an array of matrices.static void
glUniformMatrix3fvARB(int location, boolean transpose, float[] value)
Array version of:UniformMatrix3fvARB
static void
glUniformMatrix3fvARB(int location, boolean transpose, java.nio.FloatBuffer value)
Loads a 3x3 matrix of floating-point valuescount
times into a uniform location defined as a matrix or an array of matrices.static void
glUniformMatrix4fvARB(int location, boolean transpose, float[] value)
Array version of:UniformMatrix4fvARB
static void
glUniformMatrix4fvARB(int location, boolean transpose, java.nio.FloatBuffer value)
Loads a 4x4 matrix of floating-point valuescount
times into a uniform location defined as a matrix or an array of matrices.static void
glUseProgramObjectARB(int programObj)
Installs the executable code as part of current rendering state if the program objectprogramObj
contains valid executable code, i.e.static void
glValidateProgramARB(int programObj)
Validates the program objectprogramObj
against the GL state at that moment.
-
-
-
Field Detail
-
GL_PROGRAM_OBJECT_ARB
Accepted by thepname
argument of GetHandleARB.
-
GL_OBJECT_TYPE_ARB, GL_OBJECT_SUBTYPE_ARB, GL_OBJECT_DELETE_STATUS_ARB, GL_OBJECT_COMPILE_STATUS_ARB, GL_OBJECT_LINK_STATUS_ARB, GL_OBJECT_VALIDATE_STATUS_ARB, GL_OBJECT_INFO_LOG_LENGTH_ARB, GL_OBJECT_ATTACHED_OBJECTS_ARB, GL_OBJECT_ACTIVE_UNIFORMS_ARB, GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB, GL_OBJECT_SHADER_SOURCE_LENGTH_ARB
Accepted by thepname
parameter of GetObjectParameter{fi}vARB.
-
GL_SHADER_OBJECT_ARB
Returned by theparams
parameter of GetObjectParameter{fi}vARB.
-
GL_FLOAT_VEC2_ARB, GL_FLOAT_VEC3_ARB, GL_FLOAT_VEC4_ARB, GL_INT_VEC2_ARB, GL_INT_VEC3_ARB, GL_INT_VEC4_ARB, GL_BOOL_ARB, GL_BOOL_VEC2_ARB, GL_BOOL_VEC3_ARB, GL_BOOL_VEC4_ARB, GL_FLOAT_MAT2_ARB, GL_FLOAT_MAT3_ARB, GL_FLOAT_MAT4_ARB, GL_SAMPLER_1D_ARB, GL_SAMPLER_2D_ARB, GL_SAMPLER_3D_ARB, GL_SAMPLER_CUBE_ARB, GL_SAMPLER_1D_SHADOW_ARB, GL_SAMPLER_2D_SHADOW_ARB, GL_SAMPLER_2D_RECT_ARB, GL_SAMPLER_2D_RECT_SHADOW_ARB
Returned by thetype
parameter of GetActiveUniformARB.
-
-
Method Detail
-
glDeleteObjectARB
public static void glDeleteObjectARB(int obj)
Either deletes the object, or flags it for deletion. An object that is attached to a container object is not deleted until it is no longer attached to any container object, for any context. If it is still attached to at least one container object, the object is flagged for deletion. If the object is part of the current rendering state, it is not deleted until it is no longer part of the current rendering state for any context. If the object is still part of the rendering state of at least one context, it is flagged for deletion.If an object is flagged for deletion, its Boolean status bit
OBJECT_DELETE_STATUS_ARB
is set to true.DeleteObjectARB will silently ignore the value zero.
When a container object is deleted, it will detach each attached object as part of the deletion process. When an object is deleted, all information for the object referenced is lost. The data for the object is also deleted.
- Parameters:
obj
- the shader object to delete
-
glGetHandleARB
public static int glGetHandleARB(int pname)
Returns the handle to an object that is in use as part of current state.- Parameters:
pname
- the state item for which the current object is to be returned. Must be:PROGRAM_OBJECT_ARB
-
glDetachObjectARB
public static void glDetachObjectARB(int containerObj, int attachedObj)
Detaches an object from the container object it is attached to.- Parameters:
containerObj
- the container objectattachedObj
- the object to detach
-
glCreateShaderObjectARB
public static int glCreateShaderObjectARB(int shaderType)
Creates a shader object.- Parameters:
shaderType
- the type of the shader object to be created. One of:VERTEX_SHADER_ARB
FRAGMENT_SHADER_ARB
-
glShaderSourceARB
public static void glShaderSourceARB(int shaderObj, org.lwjgl.PointerBuffer string, java.nio.IntBuffer length)
Sets the source code for the specified shader objectshaderObj
to the text strings in thestring
array. If the object previously had source code loaded into it, it is completely replaced.The strings that are loaded into a shader object are expected to form the source code for a valid shader as defined in the OpenGL Shading Language Specification.
- Parameters:
shaderObj
- the shader objectstring
- an array of pointers to one or more, optionally null terminated, character strings that make up the source codelength
- 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. Iflength
is set toNULL
, all strings in thestring
argument are considered null terminated.
-
glShaderSourceARB
public static void glShaderSourceARB(int shaderObj, java.lang.CharSequence... string) public static void glShaderSourceARB(int shaderObj, java.lang.CharSequence string)
Sets the source code for the specified shader objectshaderObj
to the text strings in thestring
array. If the object previously had source code loaded into it, it is completely replaced.The strings that are loaded into a shader object are expected to form the source code for a valid shader as defined in the OpenGL Shading Language Specification.
- Parameters:
shaderObj
- the shader objectstring
- an array of pointers to one or more, optionally null terminated, character strings that make up the source code
-
glCompileShaderARB
public static void glCompileShaderARB(int shaderObj)
Compiles a shader object. Each shader object has a Boolean status,OBJECT_COMPILE_STATUS_ARB
, that is modified as a result of compilation. This status can be queried withGetObjectParameterivARB
. This status will be set toTRUE
if the shadershaderObj
was compiled without errors and is ready for use, andFALSE
otherwise. Compilation can fail for a variety of reasons as listed in the OpenGL Shading Language Specification. If CompileShaderARB failed, any information about a previous compile is lost and is not restored. Thus a failed compile does not restore the old state ofshaderObj
. IfshaderObj
does not reference a shader object, the errorINVALID_OPERATION
is generated.Note that changing the source code of a shader object, through ShaderSourceARB, does not change its compile status
OBJECT_COMPILE_STATUS_ARB
.Each shader object has an information log that is modified as a result of compilation. This information log can be queried with
GetInfoLogARB
to obtain more information about the compilation attempt.- Parameters:
shaderObj
- the shader object to compile
-
glCreateProgramObjectARB
public static int glCreateProgramObjectARB()
Creates a program object.A program object is a container object. Shader objects are attached to a program object with the command AttachObjectARB. It is permissible to attach shader objects to program objects before source code has been loaded into the shader object, or before the shader object has been compiled. It is permissible to attach multiple shader objects of the same type to a single program object, and it is permissible to attach a shader object to more than one program object.
-
glAttachObjectARB
public static void glAttachObjectARB(int containerObj, int obj)
Attaches an object to a container object.- Parameters:
containerObj
- the container objectobj
- the object to attach
-
glLinkProgramARB
public static void glLinkProgramARB(int programObj)
Links a program object.Each program object has a Boolean status,
OBJECT_LINK_STATUS_ARB
, that is modified as a result of linking. This status can be queried withGetObjectParameterivARB
. This status will be set toTRUE
if a valid executable is created, andFALSE
otherwise. Linking can fail for a variety of reasons as specified in the OpenGL Shading Language Specification. Linking will also fail if one or more of the shader objects, attached toprogramObj
, are not compiled successfully, or if more active uniform or active sampler variables are used inprogramObj
than allowed. If LinkProgramARB failed, any information about a previous link is lost and is not restored. Thus a failed link does not restore the old state ofprogramObj
. IfprogramObj
is not of typePROGRAM_OBJECT_ARB
, the errorINVALID_OPERATION
is generated.Each program object has an information log that is modified as a result of a link operation. This information log can be queried with
GetInfoLogARB
to obtain more information about the link operation.- Parameters:
programObj
- the program object to link
-
glUseProgramObjectARB
public static void glUseProgramObjectARB(int programObj)
Installs the executable code as part of current rendering state if the program objectprogramObj
contains valid executable code, i.e. has been linked successfully. If UseProgramObjectARB is called with the handle set to 0, it is as if the GL had no programmable stages and the fixed functionality paths will be used instead. IfprogramObj
cannot be made part of the current rendering state, anINVALID_OPERATION
error will be generated and the current rendering state left unmodified. This error will be set, for example, ifprogramObj
has not been linked successfully. IfprogramObj
is not of typePROGRAM_OBJECT_ARB
, the errorINVALID_OPERATION
is generated.While a program object is in use, applications are free to modify attached shader objects, compile attached shader objects, attach additional shader objects, and detach shader objects. This does not affect the link status
OBJECT_LINK_STATUS_ARB
of the program object. This does not affect the executable code that is part of the current state either. That executable code is only affected when the program object has been re-linked successfully. After such a successful re-link, theLinkProgramARB
command will install the generated executable code as part of the current rendering state if the specified program object was already in use as a result of a previous call to UseProgramObjectARB. If this re-link failed, then the executable code part of the current state does not change.- Parameters:
programObj
- the program object to use
-
glValidateProgramARB
public static void glValidateProgramARB(int programObj)
Validates the program objectprogramObj
against the GL state at that moment. Each program object has a Boolean status,OBJECT_VALIDATE_STATUS_ARB
, that is modified as a result of validation. This status can be queried withGetObjectParameterivARB
. If validation succeeded this status will be set toTRUE
, otherwise it will be set toFALSE
. If validation succeeded the program object is guaranteed to execute, given the current GL state. If validation failed, the program object is guaranteed to not execute, given the current GL state. IfprogramObj
is not of typePROGRAM_OBJECT_ARB
, the errorINVALID_OPERATION
is generated.ValidateProgramARB will validate at least as much as is done when a rendering command is issued, and it could validate more. For example, it could give a hint on how to optimize some piece of shader code.
ValidateProgramARB will store its information in the info log. This information will either be an empty string or it will contain validation information.
ValidateProgramARB is typically only useful during application development. An application should not expect different OpenGL implementations to produce identical information.
- Parameters:
programObj
- the program object to validate
-
glUniform1fARB
public static void glUniform1fARB(int location, float v0)
float version ofUniform4fARB
.- Parameters:
location
- the uniform variable locationv0
- the uniform x value
-
glUniform2fARB
public static void glUniform2fARB(int location, float v0, float v1)
vec2 version ofUniform4fARB
.- Parameters:
location
- the uniform variable locationv0
- the uniform x valuev1
- the uniform y value
-
glUniform3fARB
public static void glUniform3fARB(int location, float v0, float v1, float v2)
vec3 version ofUniform4fARB
.- Parameters:
location
- the uniform variable locationv0
- the uniform x valuev1
- the uniform y valuev2
- the uniform z value
-
glUniform4fARB
public static void glUniform4fARB(int location, float v0, float v1, float v2, float v3)
Loads a vec4 value into a uniform variable of the program object that is currently in use.- Parameters:
location
- the uniform variable locationv0
- the uniform x valuev1
- the uniform y valuev2
- the uniform z valuev3
- the uniform w value
-
glUniform1iARB
public static void glUniform1iARB(int location, int v0)
int version ofUniform1fARB
.- Parameters:
location
- the uniform variable locationv0
- the uniform x value
-
glUniform2iARB
public static void glUniform2iARB(int location, int v0, int v1)
ivec2 version ofUniform2fARB
.- Parameters:
location
- the uniform variable locationv0
- the uniform x valuev1
- the uniform y value
-
glUniform3iARB
public static void glUniform3iARB(int location, int v0, int v1, int v2)
ivec3 version ofUniform3fARB
.- Parameters:
location
- the uniform variable locationv0
- the uniform x valuev1
- the uniform y valuev2
- the uniform z value
-
glUniform4iARB
public static void glUniform4iARB(int location, int v0, int v1, int v2, int v3)
ivec4 version ofUniform4fARB
.- Parameters:
location
- the uniform variable locationv0
- the uniform x valuev1
- the uniform y valuev2
- the uniform z valuev3
- the uniform w value
-
glUniform1fvARB
public static void glUniform1fvARB(int location, java.nio.FloatBuffer value)
Loads floating-point valuescount
times into a uniform location defined as an array of float values.- Parameters:
location
- the uniform variable locationvalue
- the values to load
-
glUniform2fvARB
public static void glUniform2fvARB(int location, java.nio.FloatBuffer value)
Loads floating-point valuescount
times into a uniform location defined as an array of vec2 vectors.- Parameters:
location
- the uniform variable locationvalue
- the values to load
-
glUniform3fvARB
public static void glUniform3fvARB(int location, java.nio.FloatBuffer value)
Loads floating-point valuescount
times into a uniform location defined as an array of vec3 vectors.- Parameters:
location
- the uniform variable locationvalue
- the values to load
-
glUniform4fvARB
public static void glUniform4fvARB(int location, java.nio.FloatBuffer value)
Loads floating-point valuescount
times into a uniform location defined as an array of vec4 vectors.- Parameters:
location
- the uniform variable locationvalue
- the values to load
-
glUniform1ivARB
public static void glUniform1ivARB(int location, java.nio.IntBuffer value)
Loads integer valuescount
times into a uniform location defined as an array of integer values.- Parameters:
location
- the uniform variable locationvalue
- the values to load
-
glUniform2ivARB
public static void glUniform2ivARB(int location, java.nio.IntBuffer value)
Loads integer valuescount
times into a uniform location defined as an array of ivec2 vectors.- Parameters:
location
- the uniform variable locationvalue
- the values to load
-
glUniform3ivARB
public static void glUniform3ivARB(int location, java.nio.IntBuffer value)
Loads integer valuescount
times into a uniform location defined as an array of ivec3 vectors.- Parameters:
location
- the uniform variable locationvalue
- the values to load
-
glUniform4ivARB
public static void glUniform4ivARB(int location, java.nio.IntBuffer value)
Loads integer valuescount
times into a uniform location defined as an array of ivec4 vectors.- Parameters:
location
- the uniform variable locationvalue
- the values to load
-
glUniformMatrix2fvARB
public static void glUniformMatrix2fvARB(int location, boolean transpose, java.nio.FloatBuffer value)
Loads a 2x2 matrix of floating-point valuescount
times into a uniform location defined as a matrix or an array of matrices.- Parameters:
location
- the uniform variable locationtranspose
- ifFALSE
, the matrix is specified in column major order, otherwise in row major ordervalue
- the matrix values to load
-
glUniformMatrix3fvARB
public static void glUniformMatrix3fvARB(int location, boolean transpose, java.nio.FloatBuffer value)
Loads a 3x3 matrix of floating-point valuescount
times into a uniform location defined as a matrix or an array of matrices.- Parameters:
location
- the uniform variable locationtranspose
- ifFALSE
, the matrix is specified in column major order, otherwise in row major ordervalue
- the matrix values to load
-
glUniformMatrix4fvARB
public static void glUniformMatrix4fvARB(int location, boolean transpose, java.nio.FloatBuffer value)
Loads a 4x4 matrix of floating-point valuescount
times into a uniform location defined as a matrix or an array of matrices.- Parameters:
location
- the uniform variable locationtranspose
- ifFALSE
, the matrix is specified in column major order, otherwise in row major ordervalue
- the matrix values to load
-
glGetObjectParameterfvARB
public static void glGetObjectParameterfvARB(int obj, int pname, java.nio.FloatBuffer params)
Returns object specific parameter values.- Parameters:
obj
- the object to querypname
- the parameter to queryparams
- a buffer in which to return the parameter value
-
glGetObjectParameterivARB
public static void glGetObjectParameterivARB(int obj, int pname, java.nio.IntBuffer params)
Returns object specific parameter values.- Parameters:
obj
- the object to querypname
- the parameter to query. One of:params
- a buffer in which to return the parameter value
-
glGetObjectParameteriARB
public static int glGetObjectParameteriARB(int obj, int pname)
Returns object specific parameter values.- Parameters:
obj
- the object to querypname
- the parameter to query. One of:
-
glGetInfoLogARB
public static void glGetInfoLogARB(int obj, java.nio.IntBuffer length, java.nio.ByteBuffer infoLog)
A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. This string is called the info log and can be obtained with this command.This string will be null terminated. The number of characters in the info log is given by
OBJECT_INFO_LOG_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
. Ifobj
is a shader object, the returned info log will either be an empty string or it will contain information about the last compilation attempt for that object. Ifobj
is a program object, the returned info log will either be an empty string or it will contain information about the last link attempt or last validation attempt for that object. Ifobj
is not of typePROGRAM_OBJECT_ARB
orSHADER_OBJECT_ARB
, the errorINVALID_OPERATION
is generated. If an error occurred, the return parameterslength
andinfoLog
will be unmodified.The info log is typically only useful during application development and an application should not expect different OpenGL implementations to produce identical info logs.
- Parameters:
obj
- the shader object to querylength
- the actual number of characters written by the GL intoinfoLog
is returned inlength
, excluding the null termination. Iflength
isNULL
then the GL ignores this parameter.infoLog
- a buffer in which to return the info log
-
glGetInfoLogARB
public static java.lang.String glGetInfoLogARB(int obj, int maxLength)
A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. This string is called the info log and can be obtained with this command.This string will be null terminated. The number of characters in the info log is given by
OBJECT_INFO_LOG_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
. Ifobj
is a shader object, the returned info log will either be an empty string or it will contain information about the last compilation attempt for that object. Ifobj
is a program object, the returned info log will either be an empty string or it will contain information about the last link attempt or last validation attempt for that object. Ifobj
is not of typePROGRAM_OBJECT_ARB
orSHADER_OBJECT_ARB
, the errorINVALID_OPERATION
is generated. If an error occurred, the return parameterslength
andinfoLog
will be unmodified.The info log is typically only useful during application development and an application should not expect different OpenGL implementations to produce identical info logs.
- Parameters:
obj
- the shader object to querymaxLength
- the maximum number of characters the GL is allowed to write intoinfoLog
-
glGetInfoLogARB
public static java.lang.String glGetInfoLogARB(int obj)
A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. This string is called the info log and can be obtained with this command.This string will be null terminated. The number of characters in the info log is given by
OBJECT_INFO_LOG_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
. Ifobj
is a shader object, the returned info log will either be an empty string or it will contain information about the last compilation attempt for that object. Ifobj
is a program object, the returned info log will either be an empty string or it will contain information about the last link attempt or last validation attempt for that object. Ifobj
is not of typePROGRAM_OBJECT_ARB
orSHADER_OBJECT_ARB
, the errorINVALID_OPERATION
is generated. If an error occurred, the return parameterslength
andinfoLog
will be unmodified.The info log is typically only useful during application development and an application should not expect different OpenGL implementations to produce identical info logs.
- Parameters:
obj
- the shader object to query
-
glGetAttachedObjectsARB
public static void glGetAttachedObjectsARB(int containerObj, java.nio.IntBuffer count, java.nio.IntBuffer obj)
Returns the handles of objects attached tocontainerObj
inobj
. . The number of objects attached tocontainerObj
is given byOBJECT_ATTACHED_OBJECTS_ARB
, which can be queried withGetObjectParameterivARB
. IfcontainerObj
is not of typePROGRAM_OBJECT_ARB
, the errorINVALID_OPERATION
is generated. If an error occurred, the return parameterscount
andobj
will be unmodified.- Parameters:
containerObj
- the container object to querycount
- a buffer in which to return the actual number of object handles written by the GL intoobj
. IfNULL
then the GL ignores this parameter.obj
- a buffer in which to return the attached object handles
-
glGetUniformLocationARB
public static int glGetUniformLocationARB(int programObj, java.nio.ByteBuffer name) public static int glGetUniformLocationARB(int programObj, java.lang.CharSequence name)
Returns the location of uniform variablename
.name
has to be a null terminated string, without white space. The value of -1 will be returned ifname
does not correspond to an active uniform variable name inprogramObj
or ifname
starts with the reserved prefix "gl_". IfprogramObj
has not been successfully linked, or ifprogramObj
is not of typePROGRAM_OBJECT_ARB
, the errorINVALID_OPERATION
is generated. The location of a uniform variable does not change until the next link command is issued.A valid
name
cannot be a structure, an array of structures, or a subcomponent of a vector or a matrix. In order to identify a validname
, the "." (dot) and "[]" operators can be used inname
to operate on a structure or to operate on an array.The first element of a uniform array is identified using the name of the uniform array appended with "[0]". Except if the last part of the string
name
indicates a uniform array, then the location of the first element of that array can be retrieved by either using the name of the uniform array, or the name of the uniform array appended with "[0]".- Parameters:
programObj
- the program object to queryname
- the name of the uniform variable whose location is to be queried
-
glGetActiveUniformARB
public static void glGetActiveUniformARB(int programObj, int index, java.nio.IntBuffer length, java.nio.IntBuffer size, java.nio.IntBuffer type, java.nio.ByteBuffer name)
Determines which of the declared uniform variables are active and their sizes and types.This command provides information about the uniform selected by
index
. Theindex
of 0 selects the first active uniform, andindex
ofOBJECT_ACTIVE_UNIFORMS_ARB
- 1 selects the last active uniform. The value ofOBJECT_ACTIVE_UNIFORMS_ARB
can be queried withGetObjectParameterivARB
. Ifindex
is greater than or equal toOBJECT_ACTIVE_UNIFORMS_ARB
, the errorINVALID_VALUE
is generated.If an error occurred, the return parameters
length
,size
,type
andname
will be unmodified.The returned uniform name can be the name of built-in uniform state as well. The length of the longest uniform name in
programObj
is given byOBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
.Each uniform variable, declared in a shader, is broken down into one or more strings using the "." (dot) and "[]" operators, if necessary, to the point that it is legal to pass each string back into
GetUniformLocationARB
. Each of these strings constitutes one active uniform, and each string is assigned an index.If one or more elements of an array are active, GetActiveUniformARB will return the name of the array in
name
, subject to the restrictions listed above. The type of the array is returned intype
. Thesize
parameter contains the highest array element index used, plus one. The compiler or linker determines the highest index used. There will be only one active uniform reported by the GL per uniform array.This command will return as much information about active uniforms as possible. If no information is available,
length
will be set to zero andname
will be an empty string. This situation could arise if GetActiveUniformARB is issued after a failed link.- Parameters:
programObj
- a handle to a program object for which the commandLinkProgramARB
has been issued in the past. It is not necessary forprogramObj
to have been linked successfully. The link could have failed because the number of active uniforms exceeded the limit.index
- the uniform indexlength
- a buffer in which to return the actual number of characters written by the GL intoname
. This count excludes the null termination. Iflength
isNULL
then the GL ignores this parameter.size
- a buffer in which to return the uniform size. The size is in units of the type returned intype
.type
- a buffer in which to return the uniform typename
- a buffer in which to return the uniform name
-
glGetActiveUniformARB
public static java.lang.String glGetActiveUniformARB(int programObj, int index, int maxLength, java.nio.IntBuffer size, java.nio.IntBuffer type)
Determines which of the declared uniform variables are active and their sizes and types.This command provides information about the uniform selected by
index
. Theindex
of 0 selects the first active uniform, andindex
ofOBJECT_ACTIVE_UNIFORMS_ARB
- 1 selects the last active uniform. The value ofOBJECT_ACTIVE_UNIFORMS_ARB
can be queried withGetObjectParameterivARB
. Ifindex
is greater than or equal toOBJECT_ACTIVE_UNIFORMS_ARB
, the errorINVALID_VALUE
is generated.If an error occurred, the return parameters
length
,size
,type
andname
will be unmodified.The returned uniform name can be the name of built-in uniform state as well. The length of the longest uniform name in
programObj
is given byOBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
.Each uniform variable, declared in a shader, is broken down into one or more strings using the "." (dot) and "[]" operators, if necessary, to the point that it is legal to pass each string back into
GetUniformLocationARB
. Each of these strings constitutes one active uniform, and each string is assigned an index.If one or more elements of an array are active, GetActiveUniformARB will return the name of the array in
name
, subject to the restrictions listed above. The type of the array is returned intype
. Thesize
parameter contains the highest array element index used, plus one. The compiler or linker determines the highest index used. There will be only one active uniform reported by the GL per uniform array.This command will return as much information about active uniforms as possible. If no information is available,
length
will be set to zero andname
will be an empty string. This situation could arise if GetActiveUniformARB is issued after a failed link.- Parameters:
programObj
- a handle to a program object for which the commandLinkProgramARB
has been issued in the past. It is not necessary forprogramObj
to have been linked successfully. The link could have failed because the number of active uniforms exceeded the limit.index
- the uniform indexmaxLength
- the maximum number of characters the GL is allowed to write intoname
.size
- a buffer in which to return the uniform size. The size is in units of the type returned intype
.type
- a buffer in which to return the uniform type
-
glGetActiveUniformARB
public static java.lang.String glGetActiveUniformARB(int programObj, int index, java.nio.IntBuffer size, java.nio.IntBuffer type)
Determines which of the declared uniform variables are active and their sizes and types.This command provides information about the uniform selected by
index
. Theindex
of 0 selects the first active uniform, andindex
ofOBJECT_ACTIVE_UNIFORMS_ARB
- 1 selects the last active uniform. The value ofOBJECT_ACTIVE_UNIFORMS_ARB
can be queried withGetObjectParameterivARB
. Ifindex
is greater than or equal toOBJECT_ACTIVE_UNIFORMS_ARB
, the errorINVALID_VALUE
is generated.If an error occurred, the return parameters
length
,size
,type
andname
will be unmodified.The returned uniform name can be the name of built-in uniform state as well. The length of the longest uniform name in
programObj
is given byOBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
.Each uniform variable, declared in a shader, is broken down into one or more strings using the "." (dot) and "[]" operators, if necessary, to the point that it is legal to pass each string back into
GetUniformLocationARB
. Each of these strings constitutes one active uniform, and each string is assigned an index.If one or more elements of an array are active, GetActiveUniformARB will return the name of the array in
name
, subject to the restrictions listed above. The type of the array is returned intype
. Thesize
parameter contains the highest array element index used, plus one. The compiler or linker determines the highest index used. There will be only one active uniform reported by the GL per uniform array.This command will return as much information about active uniforms as possible. If no information is available,
length
will be set to zero andname
will be an empty string. This situation could arise if GetActiveUniformARB is issued after a failed link.- Parameters:
programObj
- a handle to a program object for which the commandLinkProgramARB
has been issued in the past. It is not necessary forprogramObj
to have been linked successfully. The link could have failed because the number of active uniforms exceeded the limit.index
- the uniform indexsize
- a buffer in which to return the uniform size. The size is in units of the type returned intype
.type
- a buffer in which to return the uniform type
-
glGetUniformfvARB
public static void glGetUniformfvARB(int programObj, int location, java.nio.FloatBuffer params)
Returns the floating-point value or values of a uniform.- Parameters:
programObj
- the program object to querylocation
- the uniform variable locationparams
- a buffer in which to return the uniform values
-
glGetUniformfARB
public static float glGetUniformfARB(int programObj, int location)
Returns the floating-point value or values of a uniform.- Parameters:
programObj
- the program object to querylocation
- the uniform variable location
-
glGetUniformivARB
public static void glGetUniformivARB(int programObj, int location, java.nio.IntBuffer params)
Returns the integer value or values of a uniform.- Parameters:
programObj
- the program object to querylocation
- the uniform variable locationparams
- a buffer in which to return the uniform values
-
glGetUniformiARB
public static int glGetUniformiARB(int programObj, int location)
Returns the integer value or values of a uniform.- Parameters:
programObj
- the program object to querylocation
- the uniform variable location
-
glGetShaderSourceARB
public static void glGetShaderSourceARB(int obj, java.nio.IntBuffer length, java.nio.ByteBuffer source)
Returns the string making up the source code for a shader object.The string
source
is a concatenation of the strings passed to OpenGL usingShaderSourceARB
. The length of this concatenation is given byOBJECT_SHADER_SOURCE_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
. Ifobj
is not of typeSHADER_OBJECT_ARB
, the errorINVALID_OPERATION
is generated. If an error occurred, the return parameterslength
andsource
will be unmodified.- Parameters:
obj
- the shader object to querylength
- a buffer in which to return the actual number of characters written by the GL intosource
, excluding the null termination. Iflength
isNULL
then the GL ignores this parameter.source
- a buffer in which to return the shader object source
-
glGetShaderSourceARB
public static java.lang.String glGetShaderSourceARB(int obj, int maxLength)
Returns the string making up the source code for a shader object.The string
source
is a concatenation of the strings passed to OpenGL usingShaderSourceARB
. The length of this concatenation is given byOBJECT_SHADER_SOURCE_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
. Ifobj
is not of typeSHADER_OBJECT_ARB
, the errorINVALID_OPERATION
is generated. If an error occurred, the return parameterslength
andsource
will be unmodified.- Parameters:
obj
- the shader object to querymaxLength
- the maximum number of characters the GL is allowed to write intosource
-
glGetShaderSourceARB
public static java.lang.String glGetShaderSourceARB(int obj)
Returns the string making up the source code for a shader object.The string
source
is a concatenation of the strings passed to OpenGL usingShaderSourceARB
. The length of this concatenation is given byOBJECT_SHADER_SOURCE_LENGTH_ARB
, which can be queried withGetObjectParameterivARB
. Ifobj
is not of typeSHADER_OBJECT_ARB
, the errorINVALID_OPERATION
is generated. If an error occurred, the return parameterslength
andsource
will be unmodified.- Parameters:
obj
- the shader object to query
-
glShaderSourceARB
public static void glShaderSourceARB(int shaderObj, org.lwjgl.PointerBuffer string, int[] length)
Array version of:ShaderSourceARB
-
glUniform1fvARB
public static void glUniform1fvARB(int location, float[] value)
Array version of:Uniform1fvARB
-
glUniform2fvARB
public static void glUniform2fvARB(int location, float[] value)
Array version of:Uniform2fvARB
-
glUniform3fvARB
public static void glUniform3fvARB(int location, float[] value)
Array version of:Uniform3fvARB
-
glUniform4fvARB
public static void glUniform4fvARB(int location, float[] value)
Array version of:Uniform4fvARB
-
glUniform1ivARB
public static void glUniform1ivARB(int location, int[] value)
Array version of:Uniform1ivARB
-
glUniform2ivARB
public static void glUniform2ivARB(int location, int[] value)
Array version of:Uniform2ivARB
-
glUniform3ivARB
public static void glUniform3ivARB(int location, int[] value)
Array version of:Uniform3ivARB
-
glUniform4ivARB
public static void glUniform4ivARB(int location, int[] value)
Array version of:Uniform4ivARB
-
glUniformMatrix2fvARB
public static void glUniformMatrix2fvARB(int location, boolean transpose, float[] value)
Array version of:UniformMatrix2fvARB
-
glUniformMatrix3fvARB
public static void glUniformMatrix3fvARB(int location, boolean transpose, float[] value)
Array version of:UniformMatrix3fvARB
-
glUniformMatrix4fvARB
public static void glUniformMatrix4fvARB(int location, boolean transpose, float[] value)
Array version of:UniformMatrix4fvARB
-
glGetObjectParameterfvARB
public static void glGetObjectParameterfvARB(int obj, int pname, float[] params)
Array version of:GetObjectParameterfvARB
-
glGetObjectParameterivARB
public static void glGetObjectParameterivARB(int obj, int pname, int[] params)
Array version of:GetObjectParameterivARB
-
glGetInfoLogARB
public static void glGetInfoLogARB(int obj, int[] length, java.nio.ByteBuffer infoLog)
Array version of:GetInfoLogARB
-
glGetAttachedObjectsARB
public static void glGetAttachedObjectsARB(int containerObj, int[] count, int[] obj)
Array version of:GetAttachedObjectsARB
-
glGetActiveUniformARB
public static void glGetActiveUniformARB(int programObj, int index, int[] length, int[] size, int[] type, java.nio.ByteBuffer name)
Array version of:GetActiveUniformARB
-
glGetUniformfvARB
public static void glGetUniformfvARB(int programObj, int location, float[] params)
Array version of:GetUniformfvARB
-
glGetUniformivARB
public static void glGetUniformivARB(int programObj, int location, int[] params)
Array version of:GetUniformivARB
-
glGetShaderSourceARB
public static void glGetShaderSourceARB(int obj, int[] length, java.nio.ByteBuffer source)
Array version of:GetShaderSourceARB
-
-