mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-05-31 17:30:16 +00:00
Cache size of char
BlittableValueType<char> caches the size of the type parameter. This way, we avoid calling Marshal.SizeOf repeatedly for every keyboard event.
This commit is contained in:
parent
128d96994b
commit
7582decf55
|
@ -684,9 +684,9 @@ namespace OpenTK.Platform.MacOS.Carbon
|
||||||
char* codeAddr = &code;
|
char* codeAddr = &code;
|
||||||
|
|
||||||
OSStatus result = API.GetEventParameter(inEvent,
|
OSStatus result = API.GetEventParameter(inEvent,
|
||||||
EventParamName.KeyMacCharCode, EventParamType.typeChar, IntPtr.Zero,
|
EventParamName.KeyMacCharCode, EventParamType.typeChar, IntPtr.Zero,
|
||||||
(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(char)), IntPtr.Zero,
|
(uint)BlittableValueType<char>.Stride, IntPtr.Zero,
|
||||||
(IntPtr)codeAddr);
|
(IntPtr)codeAddr);
|
||||||
|
|
||||||
if (result != OSStatus.NoError)
|
if (result != OSStatus.NoError)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue