File: trackirpublic.h

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (85 lines) | stat: -rw-r--r-- 1,887 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef TRACKIRPUBLIC_H_INCLUDED_
#define TRACKIRPUBLIC_H_INCLUDED_

#include "external_dll/externalcode.h"
#include "globalincs/pstypes.h"
#include "osapi/osapi.h"

#include <SDL_syswm.h>

#ifdef _WIN64
#define TRACKIRBRIDGEDLLNAME "scptrackir64.dll"
#else
#define TRACKIRBRIDGEDLLNAME "scptrackir.dll"
#endif

#define SCP_INITRESULT_SUCCESS 0
#define SCP_INITRESULT_BADKEY 1
#define SCP_INITRESULT_BADPATH 2
#define SCP_INITRESULT_PATHTOOLONG 3
#define SCP_INITRESULT_NODLL 4
#define SCP_INITRESULT_BADSIGNATURE 5
#define SCP_INITRESULT_UNABLETOREGISTER 6
#define SCP_INITRESULT_BADDATAFIELDS 7
#define SCP_INITRESULT_BADREGISTRATION 8
#define SCP_INITRESULT_BADTRANSMISSION 9

/* Exported functions */
/* HWND comes from externalcode.h */
/* These are function pointer prototypes provided for library loading */

/* Only one function doesn't return an int or a float */
typedef int ( SCP_EXT_CALLCONV *SCPTRACKIR_PFINIT )( HWND );

/* All other trackir functions return an int or a float
 *  and take no parameters
 */
typedef int ( SCP_EXT_CALLCONV *SCPTRACKIR_PFINTVOID )( );
typedef float ( SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID )( );

class TrackIRDLL : public SCP_ExternalCode
{
public:
	TrackIRDLL();

	virtual ~TrackIRDLL();

	bool Enabled() const;

	void Reset();

	/* Returns 0 on success */
	int Init(SDL_Window* window);

	int Close();

	int Query();

	float GetX() const;

	float GetY() const;

	float GetZ() const;

	float GetPitch() const;

	float GetRoll() const;

	float GetYaw() const;
private:
	/* Functions */
	SCPTRACKIR_PFINIT m_Init;
	SCPTRACKIR_PFINTVOID m_Close;
	SCPTRACKIR_PFINTVOID m_Query;

	SCPTRACKIR_PFFLOATVOID m_GetX;
	SCPTRACKIR_PFFLOATVOID m_GetY;
	SCPTRACKIR_PFFLOATVOID m_GetZ;
	SCPTRACKIR_PFFLOATVOID m_GetPitch;
	SCPTRACKIR_PFFLOATVOID m_GetRoll;
	SCPTRACKIR_PFFLOATVOID m_GetYaw;

	bool m_enabled;
};

#endif /* TRACKIRPUBLIC_H_INCLUDED_ */