mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-22 21:51:08 +00:00
Merge pull request #487 from spellizzari/develop
XInputGetStateEx obtained through ordinal
This commit is contained in:
commit
f6af0d0f4a
|
@ -371,8 +371,8 @@ namespace OpenTK.Platform.Windows
|
|||
// Load the entry points we are interested in from that dll
|
||||
GetCapabilities = (XInputGetCapabilities)Load("XInputGetCapabilities", typeof(XInputGetCapabilities));
|
||||
GetState =
|
||||
// undocumented XInputGetStateEx with support for the "Guide" button (requires XINPUT_1_3+)
|
||||
(XInputGetState)Load("XInputGetStateEx", typeof(XInputGetState)) ??
|
||||
// undocumented XInputGetStateEx (Ordinal 100) with support for the "Guide" button (requires XINPUT_1_3+)
|
||||
(XInputGetState)Load(100, typeof(XInputGetState)) ??
|
||||
// documented XInputGetState (no support for the "Guide" button)
|
||||
(XInputGetState)Load("XInputGetState", typeof(XInputGetState));
|
||||
SetState = (XInputSetState)Load("XInputSetState", typeof(XInputSetState));
|
||||
|
@ -380,6 +380,14 @@ namespace OpenTK.Platform.Windows
|
|||
|
||||
#region Private Members
|
||||
|
||||
Delegate Load(ushort ordinal, Type type)
|
||||
{
|
||||
IntPtr pfunc = Functions.GetProcAddress(dll, (IntPtr)ordinal);
|
||||
if (pfunc != IntPtr.Zero)
|
||||
return Marshal.GetDelegateForFunctionPointer(pfunc, type);
|
||||
return null;
|
||||
}
|
||||
|
||||
Delegate Load(string name, Type type)
|
||||
{
|
||||
IntPtr pfunc = Functions.GetProcAddress(dll, name);
|
||||
|
|
Loading…
Reference in a new issue