本文整理匯總了C#中SharpGL.OpenGL.DeleteShader方法的典型用法代碼示例。如果您正苦於以下問題:C# OpenGL.DeleteShader方法的具體用法?C# OpenGL.DeleteShader怎麽用?C# OpenGL.DeleteShader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SharpGL.OpenGL
的用法示例。
在下文中一共展示了OpenGL.DeleteShader方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: linkProgram
private void linkProgram(OpenGL gl, ActiveProgramValues programValues, uint glProgramHandle)
{
//TODO add debug assertions in case a shader fails to compile, or a program fails to link
var glShaderHandles = new List<uint>(programValues.AttachedShaderValues.Count);
foreach (var shaderValues in programValues.AttachedShaderValues)
{
var glShaderHandle = gl.CreateShader(shaderValues.Stage.GlEnumValue());
glShaderHandles.Add(glShaderHandle);
gl.ShaderSource(glShaderHandle, shaderValues.Source);
gl.CompileShader(glShaderHandle);
gl.AttachShader(glProgramHandle, glShaderHandle);
}
gl.LinkProgram(glProgramHandle);
foreach (var glShaderHandle in glShaderHandles)
{
gl.DetachShader(glProgramHandle, glShaderHandle);
gl.DeleteShader(glShaderHandle);
}
}
示例2: DeleteShader
/// <summary>
/// Deletes the shader and removes it from the ShaderIds-Dictionary.
/// </summary>
/// <param name="gl"></param>
/// <param name="type"></param>
public void DeleteShader(OpenGL gl, ShaderTypes type)
{
var shader = ShaderIds[type];
gl.DeleteShader(shader);
ShaderIds.Remove(type);
}