daily update on 20240305 by nitload youmu

This commit is contained in:
YoumuLiu
2024-03-05 10:17:02 +08:00
parent 1f2fca4c8f
commit 6a0cccae79
156 changed files with 23040 additions and 1385 deletions
+7 -7
View File
@@ -1,4 +1,5 @@
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Net.Security;
@@ -9,7 +10,6 @@ using System.Text;
namespace StgSharp.Graphics
{
public unsafe class VertexBuffer : BufferObjectBase
{
internal VertexBuffer(int n, IglFunc glFunc)
@@ -18,7 +18,7 @@ namespace StgSharp.Graphics
_bufferHandle = GL.GenBuffers(n);
}
public sealed override void Bind(int index)
public override sealed void Bind(int index)
{
GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferHandle[index]);
}
@@ -32,9 +32,9 @@ namespace StgSharp.Graphics
/// <param name="usage">How OpenGL use these data, defined by <see cref="BufferUsage"/></param>
public void SetValue<T>(int index, T bufferData, BufferUsage usage) where T : IMat
{
Console.WriteLine("Setting vbo data.");
GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferHandle[index]);
GL.SetBufferData(BufferType.ARRAY_BUFFER, bufferData, usage);
}
/// <summary>
@@ -51,7 +51,7 @@ namespace StgSharp.Graphics
}
/// <summary>
///
///
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Unbind()
@@ -65,13 +65,13 @@ namespace StgSharp.Graphics
GL = gl;
}
protected sealed override void Dispose(bool disposing)
protected override sealed void Dispose(bool disposing)
{
if (disposing)
{
GL.DeleteBuffers(_bufferHandle);
_bufferHandle.Release();
}
}
}
}
}