new simplified timer. and little other ops

This commit is contained in:
Youmu Liu
2025-11-18 20:39:03 +08:00
parent 81a60d1cfe
commit ece12f2ea7
28 changed files with 2254 additions and 853 deletions
+13 -2
View File
@@ -230,9 +230,18 @@ namespace StgSharp.Internal
IntPtr monitor,
IntPtr share)
{
nint handle;
fixed (byte* titlePtr = title) {
return _glfw.glfwCreateWindow(width, height, titlePtr, monitor, share);
handle = _glfw.glfwCreateWindow(width, height, titlePtr, monitor, share);
}
if (handle == 0)
{
byte* desc;
int code = _glfw.glfwGetError(&desc);
string msg = $"{code}: {Marshal.PtrToStringUTF8((nint)desc)}";
throw new InvalidOperationException(msg);
}
return handle;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -813,7 +822,9 @@ namespace StgSharp.Internal
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe IntPtr glfwGetProcAddress(ReadOnlySpan<byte> procName)
{
return glfwGetProcAddress(procName);
fixed (byte* sPtr = procName) {
return _glfw.glfwGetProcAddress(sPtr);
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1,6 +1,6 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="glfwFunction"
// file="glfw.function"
// Project: StgSharp
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.