GLSHADERSOURCE(3gl)GLSHADERSOURCE(3gl)NAME
glShaderSourceARB - Replaces the source code strings for a shader
object.
C SPECIFICATION
void glShaderSourceARB( GLhandleARB shader,
GLsizei nstrings,
const GLcharARB **strings,
const GLint *lengths)
PARAMETERS
shader Specifies handle of shader object whose source code is being
replaced.
nstrings Specifies the number of elements in the strings array.
strings Specifies a pointer to an array of strings.
lengths Specifies an array of lengths for each element in strings array.
DESCRIPTION
glShaderSourceARB sets the source code for a shader object. Any previ‐
ous source code for the shader is replaced by an array of character
strings specified by strings. strings is an array of pointers to one or
more, optionally null terminated, character strings that make up the
source code. The length argument is an array of the number of charac‐
ters in each string (the string length). Each element in this array can
be set to a negative, indicating that its accompanying string is null
terminated. If length is set to NULL, all strings in the string argu‐
ment are considered null terminated. Any length passed in excludes the
null termination character. The number of elements in the strings and
length arrays is given in count.
After the source code for a shader has been loaded, the shader object
can be compiled with glCompileShaderARB.
NOTES
Internally glShaderSourceARB makes a copy of the source code strings so
that the application can free the source code when it returns.
ERRORS
GL_INVALID_VALUE is generated if shader is not a valid shader handle.
GL_INVALID_OPERATION is generated if shader is not of type
GL_SHADER_OBJECT_ARB
GL_INVALID_OPERATION is generated glShaderSourceARB is executed between
the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGetShaderSourceARB with argument shader
SEE ALSO
glCompileShaderARB, glCreateShaderObjectARB, glDeleteObjectARB
11 Mar 04 GLSHADERSOURCE(3gl)