Shaders & programsGL 2.0

glDeleteShader

Deletes a shader object (once linked, the program no longer needs it).

Part of the family glDelete*

Signature

void glDeleteShader(GLuint shader);

How it works

After a successful glLinkProgram, the compiled code lives inside the program. The individual shader objects can be deleted right away to free memory. If a shader is still attached to a program, it is only flagged and actually deleted when detached.

Parameters

shaderGLuint

Shader to delete. 0 is ignored.

Example

example.cpp
Official Khronos documentation