Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
joystick/switch: port implementation
  • Loading branch information
vs49688 committed May 17, 2025
commit fc929f156662439a1022e37bccdc247895397eaf
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2943,6 +2943,12 @@ elseif(NINTENDO_SWITCH)
sdl_compile_options(PRIVATE -DSDL_VIDEO_STATIC_ANGLE)
endif()

if(SDL_JOYSTICK)
set(SDL_JOYSTICK_SWITCH 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/switch/*.c")
set(HAVE_SDL_JOYSTICK TRUE)
endif()

CheckPTHREAD()

if(SDL_CLOCK_GETTIME)
Expand Down
1 change: 1 addition & 0 deletions include/build_config/SDL_build_config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
#cmakedefine SDL_JOYSTICK_VITA 1
#cmakedefine SDL_JOYSTICK_WGI 1
#cmakedefine SDL_JOYSTICK_XINPUT 1
#cmakedefine SDL_JOYSTICK_SWITCH 1
#cmakedefine SDL_HAPTIC_DUMMY 1
#cmakedefine SDL_HAPTIC_LINUX 1
#cmakedefine SDL_HAPTIC_IOKIT 1
Expand Down
3 changes: 3 additions & 0 deletions src/joystick/SDL_joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ static SDL_JoystickDriver *SDL_joystick_drivers[] = {
#ifdef SDL_JOYSTICK_N3DS
&SDL_N3DS_JoystickDriver,
#endif
#ifdef SDL_JOYSTICK_SWITCH
&SDL_SWITCH_JoystickDriver,
#endif
#if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED)
&SDL_DUMMY_JoystickDriver
#endif
Expand Down
1 change: 1 addition & 0 deletions src/joystick/SDL_sysjoystick.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ extern SDL_JoystickDriver SDL_PS2_JoystickDriver;
extern SDL_JoystickDriver SDL_PSP_JoystickDriver;
extern SDL_JoystickDriver SDL_VITA_JoystickDriver;
extern SDL_JoystickDriver SDL_N3DS_JoystickDriver;
extern SDL_JoystickDriver SDL_SWITCH_JoystickDriver;
extern SDL_JoystickDriver SDL_GAMEINPUT_JoystickDriver;

// Ends C function definitions when using C++
Expand Down
Loading