本文整理匯總了C#中SharpGL.OpenGL.GetProgram方法的典型用法代碼示例。如果您正苦於以下問題:C# OpenGL.GetProgram方法的具體用法?C# OpenGL.GetProgram怎麽用?C# OpenGL.GetProgram使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SharpGL.OpenGL
的用法示例。
在下文中一共展示了OpenGL.GetProgram方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: getProgramInfoLog
private static string getProgramInfoLog(OpenGL gl, uint programHandle)
{
int[] logLength = new int[1];
gl.GetProgram(programHandle, OpenGL.GL_INFO_LOG_LENGTH, logLength);
StringBuilder log = new StringBuilder(logLength[0]);
gl.GetProgramInfoLog(programHandle, logLength[0], IntPtr.Zero, log);
return log.ToString();
}
示例2: GetLinkStatus
public static Option<string> GetLinkStatus(OpenGL gl, uint programHandle)
{
int[] status = new int[1];
gl.GetProgram(programHandle, OpenGL.GL_LINK_STATUS, status);
if (status[0] == OpenGL.GL_FALSE)
{
string log = getProgramInfoLog(gl, programHandle);
return Option<string>.Some(log);
} else
{
return Option<string>.None();
}
}
示例3: Validate
public static Option<string> Validate(OpenGL gl, uint programHandle)
{
gl.ValidateProgram(programHandle);
int[] status = new int[1];
gl.GetProgram(programHandle, OpenGL.GL_VALIDATE_STATUS, status);
if (status[0] == OpenGL.GL_FALSE)
{
string log = getProgramInfoLog(gl, programHandle);
return Option<string>.Some(log);
} else
{
return Option<string>.None();
}
}
示例4: GetProgramResult
public int[] GetProgramResult(OpenGL gl, GetProgramActions action, uint expectedLength)
{
int[] parameters = new int[expectedLength];
gl.GetProgram(ShaderProgramId, (uint)action, parameters);
return parameters;
}