Skip to content

Update NXDK SDL to 2.0.22#13

Open
Quantx wants to merge 4449 commits into
XboxDev:nxdkfrom
Quantx:nxdk-sdl-2.0.22-rebase
Open

Update NXDK SDL to 2.0.22#13
Quantx wants to merge 4449 commits into
XboxDev:nxdkfrom
Quantx:nxdk-sdl-2.0.22-rebase

Conversation

@Quantx

@Quantx Quantx commented Jul 23, 2025

Copy link
Copy Markdown

Largely a straightforward update. The joystick API had a bunch of extra functions added which the Xbox doesn't support. I've added placeholder functions for all of these which return an error code since they're unsupported on the Xbox. Minor API changes to the Audio and Video drivers.

The only real issue is with the threads implementation between the current NXDK-SDL version and 2.0.22 as there are a number of changes. NXDK-SDL seems to piggyback on the Windows threads implementation, and I'm not super familiar with the Xbox's threading implementation so I'd appreciate if someone else could take a look at that.

sezero and others added 30 commits March 17, 2022 08:43
- no need to keep the error in a static variable
- always print the error code
- reduce the required stack-size
- reduce the number of snprintf calls (and code size)
According to MSDN, we can also get SIZE_MAXHIDE and SIZE_MAXSHOW,
based on state changes to other windows. It's not clear under
what circumstances this will happen (I saw some docs indicating
it may require multiple application windows), but it doesn't seem
right to treat them as RESTORED.
Here's an IRC dump that hopefully explains the issue this fixes:

> I'm debugging something odd where, for a libre game,
  unvanquished.net (a FPS), relative mouse input in fullscreen is
  buggy
> it's like, working mostly ok, but it has a weird
  performance/cleanup bug
> after some time in relative mouse input mode, some time as low
  as 15s, usually more, the SDL sends A LOT of relative mouse
  input per frame
> almost all of which have xrel==0 && yrel==0
> by A LOT, I mean that after ~1min, it's usually in the
  thousands per frame
> each frame, a while ( SDL_PollEvent( &e)) loop reads the
  inputs, but it seems SDL is not clearing the list.
> one way to clear the list is to open the in-game console or
  menu, which switches the input mode to absolute, then close it
  which gets a working relative input mode (for some time at least)
> I've shown the issue to be present with SDL2.0.20 but not with
  2.0.14 on my system
> some other players on Arch Linux (SDL2.0.20) report a possibly
  related issue, where some keys seem to be pressed at random
> I've did some bisection on SDL master, and I've found that
  there are actually two commits involved, one breaking it
  totally (no input at all), and one fixing it partially (with
  the problem described above)

First related commit that breaks it totally:

	commit 82793ac
	Author: Sam Lantinga <slouken@libsdl.org>
	Date:   Thu Oct 14 14:26:21 2021 -0700

	    Fixed mouse warping while in relative mode

	    We should get a mouse event with an absolute position and no relative motion and shouldn't change the OS cursor position at all

Second related commit, that halfway fixes it:

	commit 31f8c3e
	Author: Sam Lantinga <slouken@libsdl.org>
	Date:   Thu Jan 6 11:27:44 2022 -0800

	    Fixed event pump starvation if the application frequently pushes its own events

Reverting the first commit did fix the issue for me, but would
probably reintroduce the bug it was fixing(?). This patch should
fix it for everyone hopefully.

DaemonEngine/Daemon#600 is the upstream
bug, and contains some early investigation.
CMake 3.19 fails to compile Objective-C with that property set

Fixes libsdl-org#5418
…er the mouse should be constrained to the center of the window or the whole window in relative mode.

For further info about the pros and cons, check out the discussion in libsdl-org#5271
The Java code needs the native functions to be implemented, even if they're not surfaced via the C API.

Fixes libsdl-org#5326
dracc and others added 30 commits July 22, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.