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

Use SDL for joypad input on Linux #25

Closed
wants to merge 1 commit into from

Conversation

EIREXE
Copy link
Contributor

@EIREXE EIREXE commented Oct 1, 2024

SDL is loaded in the same way other Linux system libraries are loaded by using a wrapped and dlopen.

Optionally, SDL can be dynamically linked into the binary.

Currently for Linux only since that platform direly needs it, but should be easy to make work on Windows once stable.

Proposal at: godotengine/godot-proposals#9000

P.S: I've made sure to strip the files as much as possible, but unless you want to be pulling your hair out by stripping files individually this is the best we can do IMO.

SDL is loaded in the same way other Linux system libraries are loaded by using a wrapped and dlopen.

Optionally, SDL can be dynamically linked into the binary.

Currently for Linux only since that platform direly needs it, but should be easy to make work on Windows once stable.

Proposal at: godotengine/godot-proposals#9000
@sDIMMaX
Copy link

sDIMMaX commented Oct 1, 2024

I think this is more than this proposal - my opinion switch to SDL in core as input and window manager.
Exist strong reasons why -
1: Codebase more easy to support, because maintainers of SDL know he work and do this very well. (check Godot issues in input system (ios, android, etc)) and we can avoid this just switching to SDL
2: Platforms - SDL have huge platforms support. I talk about consoles. Example - why on console X - this not working/have issue.

Maybe not now, but i think we can make discussion on this.

@brianhsu
Copy link

brianhsu commented Oct 4, 2024

As a Linux user, I strongly second this. SDL is basically the de-facto standard when handling gamepad in Linux. And currently the Godot implementation is not that reliable. I don't remember how many times I had to restart Godot and pray it detect my gamepad while other games using SDL had no problem at all.

I don't mind if the executable file will increase a few megabytes, it's not big deal for me IMO.

Copy link

@yarbelk yarbelk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing from a phone is headache inducing. I just looked the Python, which is about the maximum effort I could stomach in a phone


Import("env")

if "sdl" in env and env["sdl"]:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My read on sccon environments and a quick check of its usage in the project says that the falsy check is unneeded, so this could just be

But I'd like someone who actually uses sccon more than me to verify this

Suggested change
if "sdl" in env and env["sdl"]:
if "sdl" in env:

/* joypad_sdl.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we changing references to Godot in new code?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a PR that updates the copyright disclaimer script. That probably should be executed by maintainers at some point. Also, this PR has been rescued from Godot purgatory, it seems.

@KingKrouch
Copy link

Huh, the ticket got closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants