glShaderSource

glShaderSource: man2/glShaderSource.xml

glShaderSource sets the source code in shader to the source code in the array of strings specified by string. Any source code previously stored in the shader object is completely replaced. The number of strings in the array is specified by count. If length is null, each string is assumed to be null terminated. If length is a value other than null, it points to an array containing a string length for each of the corresponding elements of string. Each element in the length array may contain the length of the corresponding string (the null character is not counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or parsed at this time; they are simply copied into the specified shader object.

glShaderSource is available only if the GL version is 2.0 or greater. OpenGL copies the shader source code strings when glShaderSource is called, so an application may free its copy of the source code strings immediately after the function returns.

@OpenGL_Version(OGLIntroducedIn.V2P0)
fn_glShaderSource glShaderSource;

See Also

glCompileShader, glCreateShader, glDeleteShader

Meta