mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-02 12:01:09 +00:00
Added GetActiveAttrib, GetActiveUniform, GetActiveUniformName and GetActiveUniformBlockName overloads that return strings. Fixes issue [#1213]: "[GL] let GetUniformName() return String".
This commit is contained in:
parent
03f756f8d1
commit
3f3237a822
|
@ -663,6 +663,68 @@ namespace OpenTK.Graphics.OpenGL
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Shaders
|
||||||
|
|
||||||
|
#region GetActiveAttrib
|
||||||
|
|
||||||
|
public static string GetActiveAttrib(int program, int index, out int size, out ActiveAttribType type)
|
||||||
|
{
|
||||||
|
int length;
|
||||||
|
GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.ActiveAttributeMaxLength, out length);
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length);
|
||||||
|
GetActiveAttrib(program, index, sb.Length, out length, out size, out type, sb);
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region GetActiveUniform
|
||||||
|
|
||||||
|
public static string GetActiveUniform(int program, int uniformIndex, out int size, out ActiveUniformType type)
|
||||||
|
{
|
||||||
|
int length;
|
||||||
|
GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.ActiveUniformMaxLength, out length);
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length);
|
||||||
|
GetActiveUniform(program, uniformIndex, sb.Length, out length, out size, out type, sb);
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region GetActiveUniformName
|
||||||
|
|
||||||
|
public static string GetActiveUniformName(int program, int uniformIndex)
|
||||||
|
{
|
||||||
|
int length;
|
||||||
|
GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.ActiveUniformMaxLength, out length);
|
||||||
|
if (length == 0)
|
||||||
|
return String.Empty;
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder(length);
|
||||||
|
GetActiveUniformName(program, uniformIndex, sb.Length, out length, sb);
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region GetActiveUniformBlockName
|
||||||
|
|
||||||
|
public static string GetActiveUniformBlockName(int program, int uniformIndex)
|
||||||
|
{
|
||||||
|
int length;
|
||||||
|
GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.ActiveUniformBlockMaxNameLength, out length);
|
||||||
|
if (length == 0)
|
||||||
|
return String.Empty;
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder(length);
|
||||||
|
GetActiveUniformBlockName(program, uniformIndex, sb.Length, out length, sb);
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region public static void ShaderSource(Int32 shader, System.String @string)
|
#region public static void ShaderSource(Int32 shader, System.String @string)
|
||||||
|
|
||||||
public static void ShaderSource(Int32 shader, System.String @string)
|
public static void ShaderSource(Int32 shader, System.String @string)
|
||||||
|
@ -739,6 +801,8 @@ namespace OpenTK.Graphics.OpenGL
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region public static void PointParameter(PointSpriteCoordOriginParameter param)
|
#region public static void PointParameter(PointSpriteCoordOriginParameter param)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue