daily update on 20231113 by nitload youmu, upgrade gl loader complete

This commit is contained in:
Nitload
2023-11-14 02:51:12 +08:00
parent dac5f2455b
commit ae804553ce
84 changed files with 5492 additions and 98112 deletions
+6 -6
View File
@@ -17,7 +17,7 @@ namespace StgSharp.Graphics
_bufferID = new uint[n];
fixed (uint* ptr = _bufferID)
{
GL.gl->GenBuffers(n, ptr);
GL.gl.GenBuffers(n, ptr);
}
}
@@ -31,19 +31,19 @@ namespace StgSharp.Graphics
/// </summary>
public static void Unbind()
{
GL.gl->BindBuffer(GLconst.ARRAY_BUFFER, 0);
GL.gl.BindBuffer(GLconst.ARRAY_BUFFER, 0);
}
public void Bind(int index)
{
GL.gl->BindBuffer(GLconst.ARRAY_BUFFER, _bufferID[index]);
GL.gl.BindBuffer(GLconst.ARRAY_BUFFER, _bufferID[index]);
}
public void Dispose()
{
fixed (uint* id = _bufferID)
{
GL.gl->DeleteBuffers(_bufferID.Length, id);
GL.gl.DeleteBuffers(_bufferID.Length, id);
}
}
@@ -55,14 +55,14 @@ namespace StgSharp.Graphics
/// <param name="readType"></param>
public void SetData<T>(int index, T bufferData, BufferUsage usage) where T : IMat
{
GL.gl->BindBuffer((int)BufferType.ARRAY_BUFFER, _bufferID[index]);
GL.gl.BindBuffer((int)BufferType.ARRAY_BUFFER, _bufferID[index]);
GL.SetBufferData(BufferType.ARRAY_BUFFER, bufferData, usage);
}
public void SetDataArray<T>(int index, T[] bufferArray, BufferUsage usage) where T : struct, IConvertible
{
GL.gl->BindBuffer(GLconst.ARRAY_BUFFER, _bufferID[index]);
GL.gl.BindBuffer(GLconst.ARRAY_BUFFER, _bufferID[index]);
GL.SetBufferData(BufferType.ARRAY_BUFFER, bufferArray, usage);
}
}