The next step is to attach the shaders to
the program.
The shaders do
not have to be compiled at this time or have source code. All that is required to attach a shader to a program
is
the shader ID:
- void glAttachShader(GLuint programID, GLuint shaderID);
- programID – the
ID of the program
- shaderID –
the ID of the shader to be attached
If you have a pair
of vertex/fragment
shaders it is
necessary to attach both to
the program. A vertex/fragment shader pair is mandatory;
geometry and tessellation shaders are
optional.