Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 16 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(APP DualSense4Windows)
set(ASSET_PACKER AssetPacker)
project(${APP})


set(CMAKE_SUPPRESS_REGENERATION true)

set(SRC_INC
include/Core.hxx
include/ControllerKit.hxx
include/DualSense.hxx
include/Math.hxx
include/Utils.hxx
include/App.hxx
include/Interface.hxx
include/Types.hxx
include/Window.hxx
include/MainWindow.hxx
include/ColorPicker.hxx
)

set(SRC
Expand All @@ -24,26 +28,30 @@ set(SRC
src/Utils.cxx
src/App.cxx
src/Interface.cxx
src/MainWindow.cxx
src/ColorPicker.cxx
DualSense4Windows.exe.manifest
)

set(ASSETS "$<TARGET_FILE_DIR:${APP}>/assets")
set(ASSETS "$<TARGET_FILE_DIR:${APP}>/assets")

#add_executable(AssetPacker include/Base64.hxx src/Base64.cxx src/AssetPacker.cxx)
#target_include_directories(${ASSET_PACKER} PUBLIC external/gumbo)
#target_link_directories(${ASSET_PACKER} PUBLIC lib/)
#target_link_libraries(${ASSET_PACKER} gumbo.lib)


add_executable(${APP} WIN32 ${SRC} ${SRC_INC})
target_link_directories(${APP} PUBLIC lib/)
target_link_libraries(${APP} Xinput.lib)
target_link_libraries(${APP} AppCore.lib)
target_link_libraries(${APP} Ultralight.lib)
target_link_libraries(${APP} UltralightCore.lib)
target_link_libraries(${APP} WebCore.lib)
target_link_libraries(${APP} hidapi.lib)
target_link_libraries(${APP} setupapi)
target_link_libraries(${APP} ViGEmClient.lib)
target_include_directories(${APP} PUBLIC external/)
target_include_directories(${APP} PRIVATE include/)


add_custom_command(TARGET ${APP} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/assets/" "${ASSETS}")

add_custom_command(TARGET ${APP} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/bin" "$<TARGET_FILE_DIR:${APP}>")

14 changes: 14 additions & 0 deletions DualSense4Windows.exe.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="DualSense4Windows" type="win32"/>
<description>DualSenseController4Windows</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"

version="6.0.0.0" processorArchitecture="*"

publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
</assembly>
7 changes: 0 additions & 7 deletions assets/css/bootstrap.min.css

This file was deleted.

3 changes: 3 additions & 0 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-color: #FFFFFF;
}
18 changes: 4 additions & 14 deletions assets/html/app.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
<html>
<head>
<link rel="stylesheet" href="../css/bootstrap.min.css"/>
<link rel="stylesheet" href="../css/styles.css"/>
<script type="text/javascript" src="../js/main.js">
</script>
</head>
<body>
<div id="content">
<img src = "../img/dualsense.jpg"/>
<div class="container">
<div class="row align-items-start">
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
<div id = "device-data">
</div>
</div>
</div>
Expand Down
Binary file added assets/img/dualsense.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions assets/js/bootstrap.min.js

This file was deleted.

46 changes: 46 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

function GetDeviceNode(path, name, mode, color) {
let column = document.createElement("div");
column.className = "row align-items-start";

let cPath = document.createElement("div");
cPath.className = "col"
let pPath = document.createElement("p");
pPath.innerHTML = path;
cPath.appendChild(pPath);

let cName = document.createElement("div");
cName.className = "col";
let pName = document.createElement("p");
pName.innerHTML = name;
cName.appendChild(pName);

let cMode = document.createElement("div");
cMode.className = "col";
let pMode = document.createElement("p");
pMode.innerHTML = mode;
cMode.appendChild(pMode);


let cColor = document.createElement("div");
cColor.className = "col";
let pColor = document.createElement("p");
pColor.innerHTML = color;
cColor.appendChild(pColor);

column.appendChild(cPath);
column.appendChild(cName);
column.appendChild(cMode);
column.appendChild(cColor);
return column;
}

function OnDualSenseDevicesUpdated(devices) {
let deviceData = document.getElementById('device-data');
devices.devices.forEach((device, i) => {
deviceData.appendChild(GetDeviceNode(i, "DualSense", device.device, "Green"));
});
}

function Init() {
}
Loading