public void DetachShaders()
{
if (this.glProgramId == 0) return;
this.compiled = false;
// Determine currently attached shaders
int[] attachedShaders = new int[10];
int attachCount = 0;
GL.GetAttachedShaders(this.glProgramId, attachedShaders.Length, out attachCount, attachedShaders);
// Detach all attached shaders
for (int i = 0; i < attachCount; i++)
{
GL.DetachShader(this.glProgramId, attachedShaders[i]);
}
}