glCompileShader

Compiles a shader object

Signature

glCompileShader( GLuint ( shader ) )-> void
glCompileShader( shader )

Parameters

VariablesDescription
shader
Specifies the shader object to be compiled.

Description

glCompileShader compiles the source code strings that have been stored in the shader object specified by shader .
The compilation status will be stored as part of the shader object's state. This value will be set to GL_TRUE if the shader was compiled without errors and is ready for use, and GL_FALSE otherwise. It can be queried by calling glGetShader with arguments shader and GL_COMPILE_STATUS .
Compilation of a shader can fail for a number of reasons as specified by the OpenGL Shading Language Specification. Whether or not the compilation was successful, information about the compilation can be obtained from the shader object's information log by calling glGetShaderInfoLog .

Errors

GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.
GL_INVALID_OPERATION is generated if shader is not a shader object.

Associated Gets

glGetShaderInfoLog with argument shader
glGetShader with arguments shader and GL_COMPILE_STATUS

Version Support

glCompileShader

See Also

Copyright

Copyright
2003-2005 3Dlabs Inc. Ltd. Copyright
2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. .

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glCompileShader
{LGPL} PyMT pymt/graphx/shader.py Lines: 12, 54
{GPL3} OpenGL-Programmable 05-shader.py Lines: 36
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 36
{GPL3} OpenGL-Programmable 09-gles2.py Lines: 37
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 36
{GPL3} OpenGL-Programmable 10-gl3.2core.py Lines: 36
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 36