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 May 20, 2024
1 parent 668d5bb commit 08f7d57
Show file tree
Hide file tree
Showing 64 changed files with 29,868 additions and 2 deletions.
5 changes: 5 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,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-reflect/
Comment: SPIRV-Reflect
Copyright: 2017-2022, Google Inc.
Expand Down
3 changes: 3 additions & 0 deletions drivers/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ if env["opengl3"]:
SConscript("gles3/SCsub")
SConscript("egl/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")
1,910 changes: 1,910 additions & 0 deletions drivers/sdl/SDL2-so_wrap.c

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

Loading

0 comments on commit 08f7d57

Please sign in to comment.