From 7678a17ab76246199b5ed54ea3d1cbdd9fe1d180 Mon Sep 17 00:00:00 2001 From: Spitko Date: Wed, 17 Sep 2025 22:21:57 -0700 Subject: [PATCH 1/5] sdl3 compat --- hxd/Window.hl.hx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hxd/Window.hl.hx b/hxd/Window.hl.hx index 8aa8ae5b3d..41745df662 100644 --- a/hxd/Window.hl.hx +++ b/hxd/Window.hl.hx @@ -293,11 +293,9 @@ class Window { var forced = onMouseModeChange(mouseMode, v); if (forced != null) v = forced; - #if hldx + #if ( hldx || hlsdl ) window.setRelativeMouseMode(v != Absolute); return mouseMode = v; - #elseif hlsdl - sdl.Sdl.setRelativeMouseMode(v != Absolute); #else if ( v != Absolute ) throw "Not implemented"; #end From e3f2b79558e5dd1cf2fad7ac194cfe9c82e89943 Mon Sep 17 00:00:00 2001 From: Spitko Date: Fri, 19 Sep 2025 20:49:20 -0700 Subject: [PATCH 2/5] Fix controllers --- hxd/Pad.hx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hxd/Pad.hx b/hxd/Pad.hx index 0e3886c70b..f784b76fe3 100644 --- a/hxd/Pad.hx +++ b/hxd/Pad.hx @@ -312,6 +312,10 @@ class Pad { static var pads : Map = new Map(); #end + #if hlsdl + static var pendingPadIds: Array = []; + #end + /** Wait until a gamepad gets connected. On some platforms, this might require the user to press a button until it activates **/ @@ -324,10 +328,13 @@ class Pad { #if hlsdl if( !initDone ) { initDone = true; - var c = @:privateAccess GameController.gctrlCount(); - for( idx in 0...c ) - initPad( idx ); haxe.MainLoop.add(syncPads); + + for( id in pendingPadIds ) + initPad( id ); + + pendingPadIds = null; + } #elseif (hldx || usesys) if( !initDone ){ @@ -427,6 +434,10 @@ class Pad { case GControllerAdded: if( initDone ) initPad(e.controller); + #if hlsdl + else + pendingPadIds.push( e.controller ); + #end case GControllerRemoved: if( p != null ){ pads.remove( p.index ); From ec797595a155d764572742d51398ab0a87fb3467 Mon Sep 17 00:00:00 2001 From: Spitko Date: Sat, 20 Sep 2025 15:48:52 -0700 Subject: [PATCH 3/5] Revert window change --- hxd/Window.hl.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hxd/Window.hl.hx b/hxd/Window.hl.hx index 41745df662..8aa8ae5b3d 100644 --- a/hxd/Window.hl.hx +++ b/hxd/Window.hl.hx @@ -293,9 +293,11 @@ class Window { var forced = onMouseModeChange(mouseMode, v); if (forced != null) v = forced; - #if ( hldx || hlsdl ) + #if hldx window.setRelativeMouseMode(v != Absolute); return mouseMode = v; + #elseif hlsdl + sdl.Sdl.setRelativeMouseMode(v != Absolute); #else if ( v != Absolute ) throw "Not implemented"; #end From f46f096b163e0c8da737a138b30c7a1cdb42ff0b Mon Sep 17 00:00:00 2001 From: Spitko Date: Mon, 22 Sep 2025 21:51:13 -0700 Subject: [PATCH 4/5] Use SDL3 joystick list API under a version guard. --- hxd/Pad.hx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/hxd/Pad.hx b/hxd/Pad.hx index f784b76fe3..14d8a20447 100644 --- a/hxd/Pad.hx +++ b/hxd/Pad.hx @@ -312,9 +312,6 @@ class Pad { static var pads : Map = new Map(); #end - #if hlsdl - static var pendingPadIds: Array = []; - #end /** Wait until a gamepad gets connected. On some platforms, this might require the user to press a button until it activates @@ -328,13 +325,16 @@ class Pad { #if hlsdl if( !initDone ) { initDone = true; + #if (hlsdl >= version("1.17.0")) + var sticks = sdl.Sdl.getJoysticks(); + for( stick in sticks ) + initPad( stick ); + #else + var c = @:privateAccess GameController.gctrlCount(); + for( idx in 0...c ) + initPad( idx ); + #end haxe.MainLoop.add(syncPads); - - for( id in pendingPadIds ) - initPad( id ); - - pendingPadIds = null; - } #elseif (hldx || usesys) if( !initDone ){ @@ -434,10 +434,6 @@ class Pad { case GControllerAdded: if( initDone ) initPad(e.controller); - #if hlsdl - else - pendingPadIds.push( e.controller ); - #end case GControllerRemoved: if( p != null ){ pads.remove( p.index ); From 9caea3095bff1e48c4c72f0dfaa7e6c19df9afb0 Mon Sep 17 00:00:00 2001 From: Spitko Date: Wed, 24 Sep 2025 20:01:41 -0700 Subject: [PATCH 5/5] Remove extra whitespace, drop version req to 1.16 --- hxd/Pad.hx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hxd/Pad.hx b/hxd/Pad.hx index 14d8a20447..80008df926 100644 --- a/hxd/Pad.hx +++ b/hxd/Pad.hx @@ -312,7 +312,6 @@ class Pad { static var pads : Map = new Map(); #end - /** Wait until a gamepad gets connected. On some platforms, this might require the user to press a button until it activates **/ @@ -325,7 +324,7 @@ class Pad { #if hlsdl if( !initDone ) { initDone = true; - #if (hlsdl >= version("1.17.0")) + #if (hlsdl >= version("1.16.0")) var sticks = sdl.Sdl.getJoysticks(); for( stick in sticks ) initPad( stick );