Skip to content

Commit

Permalink
Use SDL for joypad input on Linux
Browse files Browse the repository at this point in the history
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
1 parent e3213aa commit 94626df
Show file tree
Hide file tree
Showing 64 changed files with 30,011 additions and 2 deletions.
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"]:
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

0 comments on commit 94626df

Please sign in to comment.