Graphics Reference
In-Depth Information
void
glDeleteShader
(GLuint
shader
)
shader
handle to the shader object to delete
Note that if a shader is attached to a program object (more on this later),
calling
glDeleteShader
will not immediately delete the shader. Rather,
the shader will be marked for deletion and its memory will be freed once
the shader is no longer attached to any program objects.
Once you have a shader object created, typically the next thing you will
do is provide the shader source code using
glShaderSource
.
void
glShaderSource
(GLuint
shader
, GLsizei
count
,
const GLchar* const *
string,
const GLint *
length
)
handle to the shader object.
shader
the number of shader source strings. A shader can be
composed of a number of source strings, although each
shader can have only one
main
function.
count
pointer to an array of strings holding
count
number of
shader source strings.
string
pointer to an array of
count
integers that holds the size of
each respective shader string. If
length
is
NULL
, the shader
strings are assumed to be null terminated. If
length
is not
NULL
, then each element of
length
holds the number of
characters in the corresponding shader in the
string
array.
If the value of
length
for any element is less than zero, then
that string is assumed to be null terminated.
length
Once the shader source has been specified, the next step is to compile the
shader using
glCompileShader
.
void
glCompileShader
(GLuint
shader
)
shader
handle to the shader object to compile