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
+8 -10
View File
@@ -9,9 +9,7 @@ namespace StgSharp.Graphics
{
public static unsafe partial class GL
{
internal unsafe static GLcontext* gl;
internal unsafe static GLcontext gl;
/// <summary>
/// sets the framebuffer resize callback of the specified <see cref="Form"/>,
@@ -38,7 +36,7 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void ClearColor(float R, float G, float B, float A)
{
ClearColor(R, G, B, A);
gl.ClearColor(R, G, B, A);
}
/// <summary>
@@ -130,7 +128,7 @@ namespace StgSharp.Graphics
public static unsafe uint CreatGraphicProgram()
{
return gl->CreateProgram();
return gl.CreateProgram();
}
@@ -156,7 +154,7 @@ namespace StgSharp.Graphics
LogType.Error);
return;
}
gl->DrawElements((uint)mode, count, a, (void*)ptr);
gl.DrawElements((uint)mode, count, a, (void*)ptr);
}
@@ -192,7 +190,7 @@ namespace StgSharp.Graphics
public static unsafe void SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage) where T : IMat
{
int size = sizeof(T);
gl->BufferData(
gl.BufferData(
(uint)bufferType,
size,
&bufferData,
@@ -202,14 +200,14 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void ClearGraphicError()
{
while (gl->GetError() != 0) { }
while (gl.GetError() != 0) { }
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void GetGraphicError()
{
string error = null;
uint code = gl->GetError();
uint code = gl.GetError();
while (code != 0)
{
error += $"OpenGL error {code}\n";
@@ -240,7 +238,7 @@ namespace StgSharp.Graphics
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
fixed (void* bufferPtr = &bufferArray[0])
gl->BufferData(
gl.BufferData(
(uint)bufferType,
size,
bufferPtr,