Skip to content

Commit

Permalink
Move all code from the old driver
Browse files Browse the repository at this point in the history
Change driver name
Added additional driver files
Configure vscode to launch and debug steam vr
Added lilang library
  • Loading branch information
Eirenliel committed Apr 5, 2021
1 parent 3483c4b commit 9156dff
Show file tree
Hide file tree
Showing 41 changed files with 5,981 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "libraries/openvr"]
path = libraries/openvr
url = https://github.com/ValveSoftware/openvr.git
[submodule "libraries/linalg"]
path = libraries/linalg
url = https://github.com/sgorsten/linalg.git
36 changes: 36 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "VRServer",
"type": "cppvsdbg",
"request": "launch",
"program": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\SteamVR\\bin\\win64\\vrserver.exe",
"args": [
"--keepalive"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
},
{
"name": "SteamVR",
"type": "cppvsdbg",
"request": "launch",
"program": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\SteamVR\\bin\\win64\\vrstartup.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
}
],
"compounds": [
{
"name": "Launch",
"configurations": ["VRServer", "SteamVR"],
}
]
}
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.0.0)
project(SlimeVR-OpenVR-Driver VERSION 0.1.0)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(DRIVER_NAME "SlimeVR")

include(CTest)
enable_testing()
Expand Down Expand Up @@ -30,6 +31,7 @@ file(GLOB_RECURSE HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp")
file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
add_library("${PROJECT_NAME}" SHARED "${HEADERS}" "${SOURCES}")
target_include_directories("${PROJECT_NAME}" PUBLIC "${OPENVR_INCLUDE_DIR}")
target_include_directories("${PROJECT_NAME}" PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/libraries/linalg")
target_include_directories("${PROJECT_NAME}" PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src/")
target_link_libraries("${PROJECT_NAME}" PUBLIC "${OPENVR_LIB}")
set_property(TARGET "${PROJECT_NAME}" PROPERTY CXX_STANDARD 17)
Expand All @@ -41,3 +43,22 @@ source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/src" PREFIX "Source Files" FILES
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

# Build
# Copy driver assets to output folder
add_custom_command(
TARGET ${PROJECT_NAME}
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/driver/
$<TARGET_FILE_DIR:${PROJECT_NAME}>/driver
)

# Copy dll to output folder
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:${PROJECT_NAME}>
$<TARGET_FILE_DIR:${PROJECT_NAME}>/driver/${DRIVER_NAME}/bin/${PLATFORM_NAME}${PROCESSOR_ARCH}/driver_${DRIVER_NAME}$<TARGET_FILE_SUFFIX:${PROJECT_NAME}>
)
Empty file.
6 changes: 6 additions & 0 deletions driver/slimevr/driver.vrdrivermanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"alwaysActivate": true,
"name" : "SlimeVR",
"directory" : "",
"resourceOnly" : false
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added driver/slimevr/resources/icons/hmd_not_ready.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added driver/slimevr/resources/icons/hmd_ready.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added driver/slimevr/resources/icons/tracker_not_ready.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added driver/slimevr/resources/icons/tracker_ready.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions driver/slimevr/resources/input/example_controller_bindings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"jsonid": "input_profile",
"controller_type": "example_controller",
"device_class": "TrackedDeviceClass_Controller",
"resource_root": "example",
"driver_name": "example",
"input_bindingui_mode": "controller_handed",
"should_show_binding_errors": true,
"input_bindingui_left": {
"image": "{example}/icons/example_controller_left.svg"
},
"input_bindingui_right": {
"image": "{example}/icons/example_controller_right.svg"
},
"input_source": {
"/pose/raw" : {
"type" : "pose",
"binding_image_point" : [ 0,0 ]
},
"/output/haptic": {
"type": "vibration",
"binding_image_point": [0,0]
},
"/input/a": {
"type": "button",
"click": true,
"touch" : true,
"binding_image_point": [0,0]
},
"/input/b": {
"type": "button",
"click": true,
"touch" : true,
"binding_image_point": [0,0]
},
"/input/trigger" : {
"type" : "trigger",
"click" : true,
"touch" : true,
"value" : true,
"binding_image_point" : [ 0, 0 ]
},
"/input/grip" : {
"type" : "trigger",
"force" : true,
"value" : true,
"touch" : true,
"input_activity_path" : "/input/grip/force",
"input_activity_threshold" : 0.1,
"binding_image_point" : [ 0, 0 ]
},
"/input/system": {
"type": "button",
"click": true,
"touch" : true,
"binding_image_point": [0,0]
},
"/input/trackpad": {
"type": "trackpad",
"click": true,
"touch" : true,
"binding_image_point": [0,0]
},
"/input/joystick": {
"type": "joystick",
"click": true,
"touch": true,
"binding_image_point": [0,0]
},
"/input/skeleton/left" : {
"type" : "skeleton",
"skeleton": "/skeleton/hand/left",
"side" : "left",
"binding_image_point" : [ 0, 0 ]
},
"/input/skeleton/right" : {
"type" : "skeleton",
"skeleton": "/skeleton/hand/right",
"side" : "right",
"binding_image_point" : [ 0, 0 ]
}
}
}
Loading

0 comments on commit 9156dff

Please sign in to comment.