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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use SDL for joypad input on Linux
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
  • Loading branch information
EIREXE committed Oct 1, 2024
commit 94626df6e8e64928957e9f28de2bbf524205c0ce
5 changes: 5 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ Comment: RVO2
Copyright: 2016, University of North Carolina at Chapel Hill
License: Apache-2.0

Files: ./thirdparty/sdl_headers/
Comment: SDL
Copyright: 1997-2024 Sam Lantinga
License: Zlib

Files: ./thirdparty/spirv-cross/
Comment: SPIRV-Cross
Copyright: 2015-2021, Arm Limited
Expand Down
3 changes: 3 additions & 0 deletions drivers/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ if env["metal"]:
Exit(255)
SConscript("metal/SCsub")

# Input drivers
SConscript("sdl/SCsub")

# Core dependencies
SConscript("png/SCsub")

Expand Down
9 changes: 9 additions & 0 deletions drivers/sdl/SCsub
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env python

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:

if env["use_sowrap"]:
env.add_source_files(env.drivers_sources, "SDL2-so_wrap.c")

env.add_source_files(env.drivers_sources, "*.cpp")
2,010 changes: 2,010 additions & 0 deletions drivers/sdl/SDL2-so_wrap.c

Large diffs are not rendered by default.

745 changes: 745 additions & 0 deletions drivers/sdl/SDL2-so_wrap.h

Large diffs are not rendered by default.

Loading
Loading