summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt23
-rw-r--r--FTNoIR_Tracker_PT/camera.cpp7
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc.h6
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp2
-rw-r--r--ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h31
-rw-r--r--ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui170
-rw-r--r--ftnoir_tracker_rift/ftnoir_tracker_rift.cpp2
7 files changed, 133 insertions, 108 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c5bed0f..ba4857a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -342,10 +342,10 @@ endif()
if(WIN32 AND SDK_VJOY)
include_directories(${SDK_VJOY})
add_library(opentrack-proto-vjoy SHARED ${opentrack-proto-vjoy-c} ${opentrack-proto-vjoy-moc} ${opentrack-proto-vjoy-uih} ${opentrack-proto-vjoy-rcc})
- target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/vjoy.lib")
+ target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/VJoy.dll")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
SET_TARGET_PROPERTIES(opentrack-proto-vjoy
- PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt")
+ PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt -Wl,--enable-stdcall-fixup")
endif()
endif()
@@ -362,7 +362,7 @@ endif()
add_library(opentrack-proto-simconnect SHARED ${opentrack-proto-simconnect-c} ${opentrack-proto-simconnect-moc} ${opentrack-proto-simconnect-uih} ${opentrack-proto-simconnect-rcc})
target_link_libraries(opentrack-proto-simconnect ${MY_QT_LIBS})
include_directories("${SDK_SIMCONNECT}/inc")
- target_link_libraries(opentrack-proto-simconnect "${SDK_SIMCONNECT}/lib/simconnect.lib")
+ target_link_libraries(opentrack-proto-simconnect "${SDK_SIMCONNECT}/lib/SimConnect.lib")
endif()
add_library(opentrack-proto-freetrack SHARED ${opentrack-proto-freetrack-c} ${opentrack-proto-freetrack-moc} ${opentrack-proto-freetrack-uih} ${opentrack-proto-freetrack-rcc})
@@ -458,16 +458,19 @@ endif()
endif()
if(SDK_RIFT)
- include_directories("${SDK_RIFT}/include")
+ include_directories("${SDK_RIFT}/Include")
include_directories("${SDK_RIFT}/Src")
add_library(opentrack-tracker-rift SHARED ${opentrack-tracker-rift-c} ${opentrack-tracker-rift-moc} ${opentrack-tracker-rift-uih} ${opentrack-tracker-rift-rcc})
target_link_libraries(opentrack-tracker-rift ${MY_QT_LIBS})
if(WIN32)
- target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/lib/win32/libovr.lib" winmm.lib)
+ target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/Lib/Win32/libovr.lib" winmm.lib)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
SET_TARGET_PROPERTIES(opentrack-tracker-rift
- PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt")
+ PROPERTIES
+ LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt"
+ COMPILE_FLAGS "-fno-strict-aliasing"
+ )
endif()
endif()
@@ -477,7 +480,13 @@ endif()
add_library(opentrack-tracker-hydra SHARED ${opentrack-tracker-hydra-c} ${opentrack-tracker-hydra-moc} ${opentrack-tracker-hydra-uih} ${opentrack-tracker-hydra-rcc})
target_link_libraries(opentrack-tracker-hydra ${MY_QT_LIBS})
if(WIN32)
- target_link_libraries(opentrack-tracker-hydra "${SDK_HYDRA}/lib/win32/release_static/sixense_s.lib" "${SDK_HYDRA}/lib/win32/release_static/sixense_utils_s.lib")
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ target_link_libraries(opentrack-tracker-hydra "${SDK_HYDRA}/lib/win32/release_dll/sixense.lib" "${SDK_HYDRA}/lib/win32/release_dll/sixense_utils.lib")
+ install(FILES "${SDK_HYDRA}/bin/win32/release_dll/sixense.dll" "${SDK_HYDRA}/bin/win32/release_dll/sixense_utils.dll"
+ DESTINATION .)
+ else()
+ target_link_libraries(opentrack-tracker-hydra "${SDK_HYDRA}/lib/win32/release_static/sixense_s.lib" "${SDK_HYDRA}/lib/win32/release_static/sixense_utils_s.lib")
+ endif()
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
SET_TARGET_PROPERTIES(opentrack-tracker-hydra
diff --git a/FTNoIR_Tracker_PT/camera.cpp b/FTNoIR_Tracker_PT/camera.cpp
index a372373d..14f7a6be 100644
--- a/FTNoIR_Tracker_PT/camera.cpp
+++ b/FTNoIR_Tracker_PT/camera.cpp
@@ -14,6 +14,11 @@ using namespace cv;
#include <unistd.h>
#endif
+#if defined(OPENTRACK_API) && defined(_WIN32)
+#include <windows.h>
+#include <dshow.h>
+#endif
+
#ifdef OPENTRACK_API
void get_camera_device_names(std::vector<std::string>& device_names) {
# if defined(_WIN32)
@@ -23,7 +28,7 @@ void get_camera_device_names(std::vector<std::string>& device_names) {
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pSysDevEnum);
if (FAILED(hr))
{
- return ret;
+ return;
}
// Obtain a class enumerator for the video compressor category.
IEnumMoniker *pEnumCat = NULL;
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h
index b3596722..8fcf7c1f 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h
@@ -37,11 +37,11 @@
#define SIMCONNECT_H_NOMANIFEST
#define _WIN32_WINNT 0x0502
-#include <Windows.h>
+#include <windows.h>
#include <SimConnect.h>
-#include <..\ftnoir_protocol_base\ftnoir_protocol_base.h>
-#include <ui_FTNoIR_SCcontrols.h>
+#include <ftnoir_protocol_base/ftnoir_protocol_base.h>
+#include <ui_ftnoir_sccontrols.h>
#include <QMessageBox>
#include <QSettings>
#include <QLibrary>
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp
index fce8753a..59a921b8 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp
@@ -22,7 +22,7 @@
* with this program; if not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
-#include "ftnoir_protocol_SC.h"
+#include "ftnoir_protocol_sc.h"
#include <QDebug>
#include "facetracknoir/global-settings.h"
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h
index 5c260d2e..30d89572 100644
--- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h
+++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h
@@ -28,8 +28,8 @@
#pragma once
#include "ftnoir_protocol_base/ftnoir_protocol_base.h"
#include "ui_ftnoir_vjoy_controls.h"
-#include <Windows.h>
-#include <VJoy.h>
+#include <windows.h>
+
#include <QThread>
#include <QUdpSocket>
#include <QMessageBox>
@@ -92,3 +92,30 @@ public:
void getIcon(QIcon *icon) { *icon = QIcon(":/images/vjoy.png"); }
};
+
+#define VJOY_AXIS_MIN -32768
+#define VJOY_AXIS_NIL 0
+#define VJOY_AXIS_MAX 32767
+
+#include <pshpack1.h>
+
+typedef struct _JOYSTICK_STATE
+{
+ UCHAR ReportId; // Report Id
+ SHORT XAxis; // X Axis
+ SHORT YAxis; // Y Axis
+ SHORT ZAxis; // Z Axis
+ SHORT XRotation; // X Rotation
+ SHORT YRotation; // Y Rotation
+ SHORT ZRotation; // Z Rotation
+ SHORT Slider; // Slider
+ SHORT Dial; // Dial
+ USHORT POV; // POV
+ UINT32 Buttons; // 32 Buttons
+} JOYSTICK_STATE, * PJOYSTICK_STATE;
+
+#include <poppack.h>
+
+extern "C" BOOL __stdcall VJoy_Initialize(PCHAR name, PCHAR serial);
+extern "C" VOID __stdcall VJoy_Shutdown();
+extern "C" BOOL __stdcall VJoy_UpdateJoyState(int id, PJOYSTICK_STATE pJoyState);
diff --git a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui
index eaf5b9d6..612c61f1 100644
--- a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui
+++ b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>UIRiftControls</class>
- <widget class="QWidget" name="UIHydraControls">
+ <widget class="QWidget" name="UIRiftControls">
+ <property name="windowModality">
+ <enum>Qt::ApplicationModal</enum>
+ </property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>411</width>
- <height>142</height>
+ <height>145</height>
</rect>
</property>
<property name="windowTitle">
@@ -45,97 +48,78 @@
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
-
-
-
- <item row="0" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Pitch:</string>
- </property>
- </widget>
- </item>
-
- <item row="0" column="1">
- <widget class="QCheckBox" name="chkEnablePitch">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
-
- <item row="1" column="0">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>Yaw:</string>
- </property>
- </widget>
- </item>
-
-
- <item row="1" column="1">
- <widget class="QCheckBox" name="chkEnableYaw">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
-
-
-
- <item row="2" column="0">
- <widget class="QLabel" name="label_11">
- <property name="text">
- <string>Roll:</string>
- </property>
- </widget>
- </item>
-
- <item row="2" column="1">
- <widget class="QCheckBox" name="chkEnableRoll">
- <property name="maximumSize">
- <size>
- <width>20</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
-
-
-
-
-
-
-
-
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Pitch:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="chkEnablePitch">
+ <property name="maximumSize">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>Yaw:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="chkEnableYaw">
+ <property name="maximumSize">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_11">
+ <property name="text">
+ <string>Roll:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="chkEnableRoll">
+ <property name="maximumSize">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</widget>
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
index f5e1f5fa..0c3984ac 100644
--- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
+++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
@@ -55,7 +55,7 @@ void Rift_Tracker::StartTracker(QFrame* videoFrame)
//
System::Init(Log::ConfigureDefaultLog(LogMask_All));
pManager = *DeviceManager::Create();
- DeviceEnumerator<HMDDevice>& enumerator = pManager->EnumerateDevices<HMDDevice>();
+ DeviceEnumerator<HMDDevice> enumerator = pManager->EnumerateDevices<HMDDevice>();
if (enumerator.IsAvailable())
{
pHMD = *enumerator.CreateDevice();