Watch
2
0
Fork
You've already forked raylib-cs
0

Focus pr on explicit type and util changes

This commit is contained in:
Rgebee 2025-09-17 19:16:39 +01:00
commit be91fe9120
15 changed files with 18 additions and 856 deletions

View file

@ -87,46 +87,4 @@ public unsafe struct Shader
/// Shader locations array (MAX_SHADER_LOCATIONS, int *)
/// </summary>
public int* Locs;
public readonly CBool IsValid => Raylib.IsShaderValid(this);
public static Shader Load(string vsFileName, string fsFileName)
{
return Raylib.LoadShader(vsFileName, fsFileName);
}
public static Shader LoadFromMemory(string vsCode, string fsCode)
{
return Raylib.LoadShaderFromMemory(vsCode, fsCode);
}
public void GetLocationAttrib(string attribName)
{
Raylib.GetShaderLocationAttrib(this, attribName);
}
public void SetValue<T>(int locationIndex, T value, ShaderUniformDataType uniformDataType) where T : unmanaged
{
Raylib.SetShaderValue(this, locationIndex, &value, uniformDataType);
}
public void SetValues<T>(int locationIndex, T[] values, ShaderUniformDataType uniformDataType) where T : unmanaged
{
Raylib.SetShaderValueV(this, locationIndex, values, uniformDataType, values.Length);
}
public void SetTexture(int locationIndex, Texture2D texture)
{
Raylib.SetShaderValueTexture(this, locationIndex, texture);
}
public void SetMatrix(int locationIndex, System.Numerics.Matrix4x4 matrix)
{
Raylib.SetShaderValueMatrix(this, locationIndex, matrix);
}
public void Unload()
{
Raylib.UnloadShader(this);
}
}