diff options
Diffstat (limited to 'ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h')
-rw-r--r-- | ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h index 5c260d2e..873b4e3c 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h @@ -28,14 +28,13 @@ #pragma once #include "ftnoir_protocol_base/ftnoir_protocol_base.h" #include "ui_ftnoir_vjoy_controls.h" -#include <Windows.h> -#include <VJoy.h> #include <QThread> #include <QUdpSocket> #include <QMessageBox> #include <QSettings> #include <math.h> #include "facetracknoir/global-settings.h" +#include <windows.h> #define FT_PROGRAMID "FT_ProgramID" @@ -43,15 +42,15 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK() { return true; } - void sendHeadposeToGame( double *headpose, double *rawheadpose ); -private: + void sendHeadposeToGame( const double *headpose ); QString getGameName() { return "Virtual joystick"; } +private: }; // Widget that has controls for FTNoIR protocol client-settings. @@ -61,10 +60,6 @@ class VJoyControls: public QWidget, public IProtocolDialog public: explicit VJoyControls(); - virtual ~VJoyControls(); - void showEvent ( QShowEvent *) {} - - void Initialize(QWidget *); void registerProtocol(IProtocol *l) {} void unRegisterProtocol() {} @@ -92,3 +87,39 @@ 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> + +#undef EXTERN_C +#if _MSC_VER +# define EXTERN_C +#else +# define EXTERN_C extern "C" +#endif +#if _MSC_VER +# pragma comment(linker, "/implib:vjoy.def") +#endif +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); |