Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Xinput with SDL2 #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Replace Xinput with SDL2 #38

wants to merge 2 commits into from

Conversation

joao678
Copy link

@joao678 joao678 commented Jan 16, 2024

Objective: Replace Xinput with SDL2

Reason: Since XtendedInput currently kills DirectInput, this allows it to be brought back in a way that doesn't affect the rest of functionality and keeps the core xinput functionality too as SDL2 already deals with that. It manages controllers in a standardized way so that A,B,X,Y buttons and such are handled the same for every controller regardless if it's xinput or not. Also no need to use external wrappers such as Xoutput or ds4windows, it works out of the box.

Tested with: DualSense controller in NFSU2
Platform: Windows 11

Notes:
Make sure to copy SDL2 32bit dll to the scripts folder in order for it to work
This can be extended further too, SDL2 supports adaptive triggers on the PS5 controller, LED Color lights for PS4/PS5 controllers and vibration for any controller
This method possibly works for NFS-XtendedInput

@xan1242
Copy link
Owner

xan1242 commented Jan 16, 2024

Hey, this is a pretty big change, so there's a few things I'd like to address.

First off - thank you for this, we could use SDL2 for sure!

Secondly, since I didn't expect this to happen, let me outline my plans with the XtendedInput project(s):

  • Reorganize units into their own source files
  • Rework Win32/OS cursor stuff
  • Proper raw input
  • Get the remap menu working
  • Rumble
  • Wheel support & force feedback
  • Support for more APIs (even reimplement DirectInput if possible)

That being said, before merging I'd like you to do the following changes:

  1. Keep XInput. I do not see the point in actually removing it outright. There could be multiple build configurations which use only SDL2, only XInput or both (in which case an option in the ini would have to be added).
    The idea behind using XInput was to keep the dependency chain to a minimum. This is a Win32 game, so Win32 stuff is in focus and takes priority. (Also not to mention rumble/FF stuff is a challenge of its own)
  2. Remove SDL2 from the repository itself - put it in a gitignore and distribute externally, or, implement it as a submodule (if possible). I do not want to distribute SDL2 within the repository directly. (This also goes for the dll and lib files)

@KinecticStump
Copy link

KinecticStump commented Aug 26, 2024

Hey, this is a pretty big change, so there's a few things I'd like to address.

First off - thank you for this, we could use SDL2 for sure!

Secondly, since I didn't expect this to happen, let me outline my plans with the XtendedInput project(s):

* Reorganize units into their own source files

* Rework Win32/OS cursor stuff

* Proper raw input

* Get the remap menu working

* Rumble

* Wheel support & force feedback

* Support for more APIs (even reimplement DirectInput if possible)

That being said, before merging I'd like you to do the following changes:

1. Keep XInput. I do not see the point in actually removing it outright.  There could be multiple build configurations which use only SDL2, only XInput or both (in which case an option in the ini would have to be added).
   The idea behind using XInput was to keep the dependency chain to a minimum. This is a Win32 game, so Win32 stuff is in focus and takes priority. (Also not to mention rumble/FF stuff is a challenge of its own)

2. Remove SDL2 from the repository itself - put it in a gitignore and distribute externally, or, implement it as a submodule (if possible). I do not want to distribute SDL2 within the repository directly. (This also goes for the dll and lib files)

Please do. I really need rumble on Underground 2. Especially when coming from the PS2 version which has that feature but at same time the consoles don't have the modding capabilities that are essential like disabling region locked cars and Extreme Package engine sound replacers.

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.

3 participants