mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-22 23:25:46 +00:00
chore: Update Ryujinx.SDL2-CS to 2.24.2 (#3892)
* chore: Update Ryujinx.SDL2-CS to 2.24.2 * Disable SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS
This commit is contained in:
parent
65778a6b78
commit
548bfd60a2
3 changed files with 10 additions and 7 deletions
|
@ -40,20 +40,16 @@ namespace Ryujinx.Headless.SDL2.Vulkan
|
||||||
return (IntPtr)surfaceHandle;
|
return (IntPtr)surfaceHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Fix this in SDL2-CS.
|
|
||||||
[DllImport("SDL2", EntryPoint = "SDL_Vulkan_GetInstanceExtensions", CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
public static extern SDL_bool SDL_Vulkan_GetInstanceExtensions_Workaround(IntPtr window, out uint count, IntPtr names);
|
|
||||||
|
|
||||||
public unsafe string[] GetRequiredInstanceExtensions()
|
public unsafe string[] GetRequiredInstanceExtensions()
|
||||||
{
|
{
|
||||||
if (SDL_Vulkan_GetInstanceExtensions_Workaround(WindowHandle, out uint extensionsCount, IntPtr.Zero) == SDL_bool.SDL_TRUE)
|
if (SDL_Vulkan_GetInstanceExtensions(WindowHandle, out uint extensionsCount, IntPtr.Zero) == SDL_bool.SDL_TRUE)
|
||||||
{
|
{
|
||||||
IntPtr[] rawExtensions = new IntPtr[(int)extensionsCount];
|
IntPtr[] rawExtensions = new IntPtr[(int)extensionsCount];
|
||||||
string[] extensions = new string[(int)extensionsCount];
|
string[] extensions = new string[(int)extensionsCount];
|
||||||
|
|
||||||
fixed (IntPtr* rawExtensionsPtr = rawExtensions)
|
fixed (IntPtr* rawExtensionsPtr = rawExtensions)
|
||||||
{
|
{
|
||||||
if (SDL_Vulkan_GetInstanceExtensions_Workaround(WindowHandle, out extensionsCount, (IntPtr)rawExtensionsPtr) == SDL_bool.SDL_TRUE)
|
if (SDL_Vulkan_GetInstanceExtensions(WindowHandle, out extensionsCount, (IntPtr)rawExtensionsPtr) == SDL_bool.SDL_TRUE)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < extensions.Length; i++)
|
for (int i = 0; i < extensions.Length; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Ryujinx.SDL2-CS" Version="2.0.22-build20" />
|
<PackageReference Include="Ryujinx.SDL2-CS" Version="2.24.2-build21" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -43,6 +43,8 @@ namespace Ryujinx.SDL2.Common
|
||||||
|
|
||||||
private SDL2Driver() {}
|
private SDL2Driver() {}
|
||||||
|
|
||||||
|
private const string SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS = "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS";
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
|
@ -60,6 +62,11 @@ namespace Ryujinx.SDL2.Common
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED, "0");
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED, "0");
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "1");
|
||||||
|
|
||||||
|
|
||||||
|
// NOTE: As of SDL2 2.24.0, joycons are combined by default but the motion source only come from one of them.
|
||||||
|
// We disable this behavior for now.
|
||||||
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS, "0");
|
||||||
|
|
||||||
if (SDL_Init(SdlInitFlags) != 0)
|
if (SDL_Init(SdlInitFlags) != 0)
|
||||||
{
|
{
|
||||||
string errorMessage = $"SDL2 initlaization failed with error \"{SDL_GetError()}\"";
|
string errorMessage = $"SDL2 initlaization failed with error \"{SDL_GetError()}\"";
|
||||||
|
|
Loading…
Reference in a new issue