swiss ok, needs more benchmark
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user