daily update on 20240407 by nitload youmu

This commit is contained in:
YoumuLiu
2024-04-07 15:08:52 +08:00
parent 127fcdbfd3
commit e1e416bb41
141 changed files with 2578 additions and 2576 deletions
+16 -16
View File
@@ -53,19 +53,19 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void AttachShader(glHandle program, glHandle shader)
{
api->glAttachShader(*program.valuePtr, shader.DirectValue);
api->glAttachShader(program.Value, shader.Value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void BindBuffer(BufferType bufferType, glHandle handle)
{
api->glBindBuffer((uint)bufferType, handle.DirectValue);
api->glBindBuffer((uint)bufferType, handle.Value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void BindTexture(uint type, glHandle texture)
{
api->glBindTexture(type, texture.DirectValue);
api->glBindTexture(type, texture.Value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -95,7 +95,7 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void CompileShader(glHandle shaderhandle)
{
api->glCompileShader(shaderhandle.DirectValue);
api->glCompileShader(shaderhandle.Value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -175,15 +175,15 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
unsafe public static void DeleteBuffers(glHandleSet handle)
{
api->glDeleteBuffers((uint)handle.length, handle.handle);
handle.Free();
api->glDeleteBuffers(handle.length, (uint*)handle.Handle);
handle.Release();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
unsafe public static void DeleteVertexArrays(glHandleSet arrays)
{
api->glDeleteVertexArrays((uint)arrays.length, arrays.handle);
arrays.Free();
api->glDeleteVertexArrays(arrays.length, (uint*)arrays.Handle);
arrays.Release();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -206,7 +206,7 @@ namespace StgSharp.Graphics
default:
InternalIO.InternalWriteLog(
$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are suporrted."}",
$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}",
LogType.Error);
return;
}
@@ -217,7 +217,7 @@ namespace StgSharp.Graphics
public static unsafe glHandleSet GenBuffers(int count)
{
glHandleSet h = new glHandleSet(count);
api->glGenBuffers((uint)count, h.handle);
api->glGenBuffers(count, (uint*)h.Handle);
return h;
}
@@ -233,7 +233,7 @@ namespace StgSharp.Graphics
public static unsafe glHandleSet GenVertexArrays(int count)
{
glHandleSet h = new glHandleSet(count);
api->glGenVertexArrays((uint)count, h.handle);
api->glGenVertexArrays(count, (uint*)h.Handle);
return h;
}
@@ -243,7 +243,7 @@ namespace StgSharp.Graphics
byte[] code = Encoding.UTF8.GetBytes(name);
fixed (byte* ptr = code)
{
return glSHandle.Alloc(api->glGetUniformLocation(program.DirectValue, ptr));
return glSHandle.Alloc(api->glGetUniformLocation(program.Value, ptr));
}
}
@@ -253,16 +253,16 @@ namespace StgSharp.Graphics
byte[] stream = Encoding.UTF8.GetBytes(codeStream);
fixed (byte* streamPtr = stream)
{
api->glShaderSource(shaderHandle.DirectValue, 1, &streamPtr, (void*)0);
api->glShaderSource(shaderHandle.Value, 1, &streamPtr, (void*)0);
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe static void MakeContexCurrent(Form form)
public unsafe static void MakeContextCurrent(Form form)
{
if (form.WindowID == IntPtr.Zero)
{
InternalIO.InternalWriteLog($"From {nameof(form)} is not initted.", LogType.Warning);
InternalIO.InternalWriteLog($"From {nameof(form)} is not inited.", LogType.Warning);
return;
}
InternalIO.glfwMakeContextCurrent(form.id);
@@ -323,7 +323,7 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void UseProgram(glHandle program)
{
api->glUseProgram(program.DirectValue);
api->glUseProgram(program.Value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]