Compile shader GLSL code and return a shader object. Shader objects can then be attached to programs an made executable on their respective processors.
OpenGL shader object handle retrieved from a glCreateShader call.
Examples
Compiling GLSL source code and attaching it to a program object:
# GLSL vertex shader source
vertexSource = '''
#version 330 core
layout (location = 0) in vec3 vertexPos;
void main()
{
gl_Position = vec4(vertexPos, 1.0);
}
'''
# compile it, specifying `GL_VERTEX_SHADER`
vertexShader = compileShader(vertexSource, GL.GL_VERTEX_SHADER)
attachShader(myProgram, vertexShader) # attach it to `myProgram`