logo
Free, Micro AI Code Reviews That Run on Git Commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt

glCompileShader - Compiles a shader object

Associated Gets

glGetShaderInfoLog() with argument shaderglGetShader() with arguments shader and GL_COMPILE_STATUSglIsShader()

C Specification

voidglCompileShader(GLuintshader);

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.

Name

       glCompileShader - Compiles a shader object

Parameters

shader
           Specifies the shader object to be compiled.

See Also

glCreateShader(), glLinkProgram(), glShaderSource()

Version Support

       ┌─────────────────┬───────────────────────────────────────────────────────────────────────┐
       │                 │                OpenGLVersion                                         │
       ├─────────────────┼─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
       │ Function2.02.13.03.13.23.34.04.14.24.34.44.5 │
       │ /               │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Feature         │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Name            │     │     │     │     │     │     │     │     │     │     │     │     │
       ├─────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
       │ glCompileShader │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │
       └─────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘

See Also