Gambas Documentation - /comp/gb.opengl.glsl/gl/detachshader

# Gl.DetachShader (gb.opengl.glsl)

Static Sub DetachShader ( Program As Integer, Shader As Integer )

Detaches a shader object from a program object to which it is attached.

### Parameters

program

  Specifies the program object from which to detach the shader object.

shader

  Specifies the shader object to be detached.

### Description

Gl.DetachShader detaches the shader object specified by shader from the program object specified by program. This command can be used to undo the effect of the command Gl.AttachShader.

If shader has already been flagged for deletion by a call to Gl.DeleteShader and it is not attached to any other program object, it will be deleted after it has been detached.

### Errors

Gl.INVALID_VALUE is generated if either program or shader is a value that was not generated by OpenGL.

Gl.INVALID_OPERATION is generated if program is not a program object.

Gl.INVALID_OPERATION is generated if shader is not a shader object.

Gl.INVALID_OPERATION is generated if shader is not attached to program.

### Associated Gets

Gl.GetAttachedShaders with the handle of a valid program object

Gl.GetShader with arguments shader and Gl.DELETE_STATUS

Gl.IsProgram

Gl.IsShader

### See also

- Gl.AttachShader

See original documentation on OpenGL website