Skip to content

Commit

Permalink
Add gamepad support for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mogemimi committed Jul 28, 2018
1 parent ee614ca commit 3c1b360
Show file tree
Hide file tree
Showing 6 changed files with 461 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build/pomdog.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'application_platform%': 'X11',
'renderers%': ['GL4'],
'audio%': 'OpenAL',
'input_devices%': [],
'input_devices%': ['Linux'],
},
}],
],
Expand Down Expand Up @@ -275,6 +275,7 @@
'../src/InputSystem/InputDeviceCreator.hpp',
'../src/InputSystem/InputDeviceFactory.cpp',
'../src/InputSystem/InputDeviceFactory.hpp',
'../src/InputSystem/NativeGamepad.hpp',
'../src/Logging/Log.cpp',
'../src/Logging/LogChannel.cpp',
'../src/Math/BoundingBox.cpp',
Expand Down Expand Up @@ -558,6 +559,10 @@
'../src/Platform.Linux/TimeSourceLinux.cpp',
'../src/Platform.Linux/TimeSourceLinux.hpp',
],
'pomdog_library_input_linux_sources': [
'../src/InputSystem.Linux/GamepadLinux.cpp',
'../src/InputSystem.Linux/GamepadLinux.hpp',
],
},
'target_defaults': {
'dependencies': [
Expand Down Expand Up @@ -746,6 +751,11 @@
],
},
}],
['"Linux" in input_devices', {
'sources': [
'<@(pomdog_library_input_linux_sources)',
],
}],
['application_platform == "X11"', {
'sources': [
'<@(pomdog_library_x11_sources)',
Expand Down
2 changes: 2 additions & 0 deletions build/pomdog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@
A9E4B867210CD9C0003F87DC /* GamepadMappings.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GamepadMappings.hpp; sourceTree = "<group>"; };
A9E4B868210CD9C0003F87DC /* GamepadHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GamepadHelper.cpp; sourceTree = "<group>"; };
A9E4B869210CD9C0003F87DC /* GamepadHelper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GamepadHelper.hpp; sourceTree = "<group>"; };
A9E4B86E210CDCC7003F87DC /* NativeGamepad.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = NativeGamepad.hpp; sourceTree = "<group>"; };
A9F213561DE35F1B0027FA45 /* BoundingFrustum.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = BoundingFrustum.hpp; sourceTree = "<group>"; };
A9F213571DE35F260027FA45 /* Plane.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Plane.hpp; sourceTree = "<group>"; };
A9F213581DE35F260027FA45 /* PlaneIntersectionType.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = PlaneIntersectionType.hpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -933,6 +934,7 @@
1C7CBAD3B25BA6B0D155A5E6 /* InputDeviceCreator.hpp */,
B7379F84C54E861AD074AA1C /* InputDeviceFactory.cpp */,
5672D00947C663520B460134 /* InputDeviceFactory.hpp */,
A9E4B86E210CDCC7003F87DC /* NativeGamepad.hpp */,
);
path = InputSystem;
sourceTree = "<group>";
Expand Down
4 changes: 4 additions & 0 deletions build/pomdog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ source_group(Utility REGULAR_EXPRESSION "(include/Pomdog|src)/U
source_group(Application REGULAR_EXPRESSION "(include/Pomdog|src)/Application/*")
source_group(InputSystem REGULAR_EXPRESSION src/InputSystem/*)
source_group(InputSystem.DirectInput REGULAR_EXPRESSION src/InputSystem.DirectInput/*)
source_group(InputSystem.Linux REGULAR_EXPRESSION src/InputSystem.Linux/*)
source_group(Platform.Apple REGULAR_EXPRESSION src/Platform.Apple/*)
source_group(Platform.Linux REGULAR_EXPRESSION src/Platform.Linux/*)
source_group(RenderSystem REGULAR_EXPRESSION src/RenderSystem/*)
Expand Down Expand Up @@ -282,6 +283,7 @@ set(POMDOG_SOURCES_CORE
${POMDOG_DIR}/src/InputSystem/InputDeviceCreator.hpp
${POMDOG_DIR}/src/InputSystem/InputDeviceFactory.cpp
${POMDOG_DIR}/src/InputSystem/InputDeviceFactory.hpp
${POMDOG_DIR}/src/InputSystem/NativeGamepad.hpp
${POMDOG_DIR}/src/Logging/Log.cpp
${POMDOG_DIR}/src/Logging/LogChannel.cpp
${POMDOG_DIR}/src/Math/BoundingBox.cpp
Expand Down Expand Up @@ -556,6 +558,8 @@ set(POMDOG_SOURCES_X11
)

set(POMDOG_SOURCES_LINUX
${POMDOG_DIR}/src/InputSystem.Linux/GamepadLinux.cpp
${POMDOG_DIR}/src/InputSystem.Linux/GamepadLinux.hpp
${POMDOG_DIR}/src/Platform.Linux/FileSystemLinux.cpp
${POMDOG_DIR}/src/Platform.Linux/TimeSourceLinux.cpp
${POMDOG_DIR}/src/Platform.Linux/TimeSourceLinux.hpp
Expand Down
Loading

0 comments on commit 3c1b360

Please sign in to comment.