libctru  v1.6.0
qtm.h
Go to the documentation of this file.
1 /**
2  * @file qtm.h
3  * @brief QTM service.
4  */
5 #pragma once
6 
7 //See also: http://3dbrew.org/wiki/QTM_Services
8 
9 /// Head tracking coordinate pair.
10 typedef struct {
11  float x; ///< X coordinate.
12  float y; ///< Y coordinate.
14 
15 /// Head tracking info.
16 typedef struct {
17  u8 flags[5]; ///< Flags.
18  u8 padding[3]; ///< Padding.
19  float floatdata_x08; ///< Unknown. Not used by System_Settings.
20  QTM_HeadTrackingInfoCoord coords0[4]; ///< Head coordinates.
21  u32 unk_x2c[5]; ///< Unknown. Not used by System_Settings.
23 
24 /// Initializes QTM.
25 Result qtmInit(void);
26 
27 /// Exits QTM.
28 void qtmExit(void);
29 
30 /**
31  * @brief Checks whether QTM is initialized.
32  * @return Whether QTM is initialized.
33  */
34 bool qtmCheckInitialized(void);
35 
36 /**
37  * @brief Checks whether a head is fully detected.
38  * @param info Tracking info to check.
39  */
41 
42 /**
43  * @brief Converts QTM coordinates to screen coordinates.
44  * @param coord Coordinates to convert.
45  * @param screen_width Width of the screen. Can be NULL to use the default value for the top screen.
46  * @param screen_height Height of the screen. Can be NULL to use the default value for the top screen.
47  * @param x Pointer to output the screen X coordinate to.
48  * @param y Pointer to output the screen Y coordinate to.
49  */
50 Result qtmConvertCoordToScreen(QTM_HeadTrackingInfoCoord *coord, float *screen_width, float *screen_height, u32 *x, u32 *y);
51 
52 /**
53  * @brief Gets the current head tracking info.
54  * @param val Normally 0.
55  * @param out Pointer to write head tracking info to.
56  */
void qtmExit(void)
Exits QTM.
s32 Result
Function result.
Definition: types.h:42
Result qtmInit(void)
Initializes QTM.
float floatdata_x08
Unknown. Not used by System_Settings.
Definition: qtm.h:19
Result QTM_GetHeadTrackingInfo(u64 val, QTM_HeadTrackingInfo *out)
Gets the current head tracking info.
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
uint32_t u32
32-bit unsigned integer
Definition: types.h:23
bool qtmCheckInitialized(void)
Checks whether QTM is initialized.
float y
Y coordinate.
Definition: qtm.h:12
Result qtmConvertCoordToScreen(QTM_HeadTrackingInfoCoord *coord, float *screen_width, float *screen_height, u32 *x, u32 *y)
Converts QTM coordinates to screen coordinates.
bool qtmCheckHeadFullyDetected(QTM_HeadTrackingInfo *info)
Checks whether a head is fully detected.
Head tracking coordinate pair.
Definition: qtm.h:10
float x
X coordinate.
Definition: qtm.h:11
Head tracking info.
Definition: qtm.h:16