daily update on 20240528 by nitload youmu

This commit is contained in:
Nitload
2024-05-28 17:45:54 +08:00
parent de399e22c2
commit 70890e3e33
88 changed files with 10678 additions and 5761 deletions
+11 -9
View File
@@ -28,38 +28,40 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.Graphics
namespace StgSharp.Graphics.GL
{
public unsafe class VertexArray : BufferObjectBase
{
internal VertexArray(int n, glRenderStream binding)
{
this.binding = binding.ContextHandle;
_bufferHandle = GL.GenVertexArrays(n);
this.binding = binding;
_bufferHandle = glFunc.GenVertexArrays(n);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override sealed void Bind(int index)
{
GL.BindVertexArray(_bufferHandle[index]);
glFunc.BindVertexArray(_bufferHandle[index]);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void BindNull()
public static void BindNull()
{
GL.BindVertexArray(glHandle.Zero);
glFunc.BindVertexArray(glHandle.Zero);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetVertexAttribute(uint index, int vertexLength, TypeCode dataType, bool isNomalized, uint stride, int pointer)
public static void SetVertexAttribute(uint index, int vertexLength, TypeCode dataType, bool isNomalized, uint stride, int pointer)
{
GL.SetVertexAttribute(
glFunc.SetVertexAttribute(
index, vertexLength, dataType,
isNomalized,
stride, pointer);
@@ -69,7 +71,7 @@ namespace StgSharp.Graphics
{
if (disposing)
{
GL.DeleteVertexArrays(_bufferHandle);
glFunc.DeleteVertexArrays(_bufferHandle);
_bufferHandle.Release();
}
}