swiss ok, needs more benchmark

This commit is contained in:
Youmu Liu
2026-03-06 18:22:30 +08:00
parent 83997f64d0
commit f6e897ed06
70 changed files with 1889 additions and 3371 deletions
+20 -8
View File
@@ -39,11 +39,18 @@ namespace StgSharp.Graphics
public string ModuleName => "Graphic";
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void InitializeModule()
public void InitializeModule(
IModuleInitializeProfile profile
)
{
GraphicFramework.LoadGlfw();
}
public void UninitializeModule()
{
GraphicFramework.glfwTerminate();
}
}
internal static unsafe partial class GraphicFramework
@@ -702,12 +709,15 @@ namespace StgSharp.Graphics
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe byte* glfwGetKeyName(
int key,
int scancode
internal static unsafe ReadOnlySpan<byte> glfwGetKeyName(
int key,
int scancode
)
{
return _glfw.glfwGetKeyName(key, scancode);
byte* ptr = _glfw.glfwGetKeyName(key, scancode);
int count = 0;
for (; ptr[count] != 0; count++) { }
return new ReadOnlySpan<byte>(ptr, count);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -717,15 +727,17 @@ namespace StgSharp.Graphics
{
return _glfw.glfwGetKeyScancode(key);
}
/**/
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe KeyStatus glfwGetKey(
IntPtr window,
int key
internal static unsafe int glfwGetKey(
IntPtr window,
int key
)
{
return _glfw.glfwGetKey(window, key);
}
/**/
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe int glfwGetMouseButton(