1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Updated wooting SDK functions to v1.2.0

https://github.com/WootingKb/wooting-rgb-sdk/releases/tag/v1.2.0
This commit is contained in:
Diogo Trindade 2020-09-10 16:25:35 +01:00
parent 9acf8fc37f
commit 2e6ff339e0
2 changed files with 8 additions and 2 deletions

View File

@ -46,7 +46,8 @@ namespace RGB.NET.Devices.Wooting.Native
_getDeviceInfoPointer = (GetDeviceInfoPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_device_info"), typeof(GetDeviceInfoPointer));
_keyboardConnectedPointer = (KeyboardConnectedPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_kbd_connected"), typeof(KeyboardConnectedPointer));
_resetPointer = (ResetPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_reset"), typeof(ResetPointer));
_resetPointer = (ResetPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_reset_rgb"), typeof(ResetPointer));
_closePointer = (ClosePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_close"), typeof(ClosePointer));
_arrayUpdateKeyboardPointer = (ArrayUpdateKeyboardPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_array_update_keyboard"), typeof(ArrayUpdateKeyboardPointer));
_arraySetSinglePointer = (ArraySetSinglePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_array_set_single"), typeof(ArraySetSinglePointer));
}
@ -81,6 +82,7 @@ namespace RGB.NET.Devices.Wooting.Native
private static GetDeviceInfoPointer _getDeviceInfoPointer;
private static KeyboardConnectedPointer _keyboardConnectedPointer;
private static ResetPointer _resetPointer;
private static ClosePointer _closePointer;
private static ArrayUpdateKeyboardPointer _arrayUpdateKeyboardPointer;
private static ArraySetSinglePointer _arraySetSinglePointer;
@ -97,6 +99,9 @@ namespace RGB.NET.Devices.Wooting.Native
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate bool ResetPointer();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate bool ClosePointer();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate bool ArrayUpdateKeyboardPointer();
@ -108,6 +113,7 @@ namespace RGB.NET.Devices.Wooting.Native
internal static IntPtr GetDeviceInfo() => _getDeviceInfoPointer();
internal static bool KeyboardConnected() => _keyboardConnectedPointer();
internal static bool Reset() => _resetPointer();
internal static bool Close() => _closePointer();
internal static bool ArrayUpdateKeyboard() => _arrayUpdateKeyboardPointer();
internal static bool ArraySetSingle(byte row, byte column, byte red, byte green, byte blue) => _arraySetSinglePointer(row, column, red, green, blue);

View File

@ -146,7 +146,7 @@ namespace RGB.NET.Devices.Wooting
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
try { _WootingSDK.Reset(); }
try { _WootingSDK.Close(); }
catch { /* Unlucky.. */ }
try { _WootingSDK.UnloadWootingSDK(); }