-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathouyaFace.s4e
222 lines (195 loc) · 5.85 KB
/
ouyaFace.s4e
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
include:
#include <s3eTypes.h>
/*
* @brief The type of the controller events.
*/
enum OuyaControllerEvent
{
OUYA_CONTROLLER_AXIS_EVENT, // analog stick action, including triggers
OUYA_CONTROLLER_BUTTON_EVENT, // buttons
kNumOuyaControllerEvents
};
/*
* @brief Controllers axis id values.
*/
enum OuyaControllerAxisId
{
OUYA_CONTROLLER_AXIS_LEFT_X = 0,
OUYA_CONTROLLER_AXIS_LEFT_Y = 1,
OUYA_CONTROLLER_AXIS_RIGHT_X = 11,
OUYA_CONTROLLER_AXIS_RIGHT_Y = 14,
OUYA_CONTROLLER_AXIS_LEFT_TRIGGER = 17,
OUYA_CONTROLLER_AXIS_RIGHT_TRIGGER = 18,
};
/*
* @brief Controller button id values.
*/
enum OuyaControllerButtonId
{
OUYA_CONTROLLER_BUTTON_DPAD_UP = 19,
OUYA_CONTROLLER_BUTTON_DPAD_DOWN = 20,
OUYA_CONTROLLER_BUTTON_DPAD_LEFT = 21,
OUYA_CONTROLLER_BUTTON_DPAD_RIGHT = 22,
OUYA_CONTROLLER_BUTTON_MENU = 82,
OUYA_CONTROLLER_BUTTON_O = 96,
OUYA_CONTROLLER_BUTTON_U = 99,
OUYA_CONTROLLER_BUTTON_Y = 100,
OUYA_CONTROLLER_BUTTON_A = 97,
OUYA_CONTROLLER_BUTTON_L1 = 102,
OUYA_CONTROLLER_BUTTON_R1 = 103,
OUYA_CONTROLLER_BUTTON_L2 = 104,
OUYA_CONTROLLER_BUTTON_R2 = 105,
OUYA_CONTROLLER_BUTTON_L3 = 106,
OUYA_CONTROLLER_BUTTON_R3 = 107,
kNumControllerButtons
};
/*
* @brief System data of an OUYA_CONTROLLER_MOTION_EVENT
*/
struct OuyaControllerAxisEvent
{
uint32 controllerId;
uint32 playerId;
uint32 axisId;
float axisValue;
};
/*
* @brief System data of an OUYA_CONTROLLER_BUTTON_EVENT
*/
struct OuyaControllerButtonEvent
{
uint32 controllerId;
uint32 playerId;
uint32 buttonId;
uint32 isPressed;
};
/*
@brief Error codes returned from OuyaFacadeRequest* callbacks.
OUYA_FACADE_NO_ERROR is success, 1-999 are HTTP status codes, >999
are internal error codes.
*/
enum OuyaFacadeError
{
OUYA_FACADE_ERROR_CANCELLED = -1,
OUYA_FACADE_ERROR_NONE = 0,
};
/*
* @brief System data of the callback for OuyaFacadeRequestGamerUUID.
*/
struct OuyaFacadeGamerUUIDResult
{
int32 error;
const char* pGamerUUID;
};
struct OuyaFacadeReceipt
{
const char* pProductId;
int32 priceInCents;
uint64 purchaseDate;
uint64 generatedDate;
};
/*
* @brief System data of the callback for OuyaFacadeRequestReceipts.
*/
struct OuyaFacadeReceiptsResult
{
int32 error;
int32 numReceipts;
const OuyaFacadeReceipt* parReceipt;
};
struct OuyaFacadeProduct
{
const char* pProductId;
const char* pName;
int32 priceInCents;
};
/*
* @brief System data of the callback for OuyaFacadeRequestProductList.
*/
struct OuyaFacadeProductListResult
{
int32 error;
int32 numProducts;
const OuyaFacadeProduct* parProduct;
};
/*
* @brief System data of the callback for OuyaFacadeRequestPurchase.
*/
struct OuyaFacadePurchaseResult
{
int32 error;
OuyaFacadeProduct productPurchased;
};
functions:
/*
* @brief Initialises the OuyaFacade.
*/
void ouyaInit(const char* pDeveloperId, const char* pApplicationKey) run_on_os_thread
/*
* @brief Terminates the OuyaFacade.
*/
void ouyaTerm() run_on_os_thread
/*
* @brief Tells you whether OuyaFacade was successfully initialised.
*/
int ouyaFacadeIsInitialised() run_on_os_thread
/*
* @brief Tells you whether the app is running on OUYA hardware.
*/
int ouyaFacadeIsRunningOnOUYAHardware() run_on_os_thread
/*
* @brief Attempts to retrieve and return a @a pValue stored under @a pKey.
*/
void ouyaFacadeGetGameData(const char* pKey, char* pBuffer, int bufferSize) run_on_os_thread
/*
* @brief Stores a @a pValue string under @a pKey. How long it will be persisted will depend on its size and usage.
*/
void ouyaFacadePutGameData(const char* pKey, const char* pValue) run_on_os_thread
/*
* @brief Sets OuyaFacade to test mode for the intents of purposes of
purchases and purchase history.
*/
void ouyaFacadeSetTestMode() run_on_os_thread
/*
* @brief Requests the UUID for the current account. The system data parameter
* of the callback will point to an OuyaFacadeGamerUUIDResult object.
*/
s3eResult ouyaFacadeRequestGamerUUID(s3eCallback pCallback, void* pUserData) run_on_os_thread
/*
* @brief Requests the receipts for the current account and app. The system
* data parameter of the callback will point to an
* OuyaFacadeReceiptsResult object.
*/
s3eResult ouyaFacadeRequestReceipts(s3eCallback pCallback, void* pUserData) run_on_os_thread
/*
* @brief Requests information for the given list of purchasables. The system
* data parameter of the callback will point to an
* OuyaFacadeProductListResult object.
*/
s3eResult ouyaFacadeRequestProductList(const char** parPurchasable, int numPurchasables, s3eCallback pCallback, void* pUserData) run_on_os_thread
/*
* @brief Requests the purchase of the the given purchasable. The system data
* parameter of the callback will point to an OuyaFacadePurchaseResult
* object.
*/
s3eResult ouyaFacadeRequestPurchase(const char* pPurchasable, s3eCallback pCallback, void* pUserData) run_on_os_thread
/*
* @brief Registers a controller event handler for the given event type.
* The system data parameter of the callback will point to objects type
* corresponding the event type.
*/
s3eResult ouyaControllerRegister(OuyaControllerEvent type, s3eCallback pCallback, void* pUserData) run_on_os_thread
/*
* @brief Unregisters the given controller event handler for the given event
* type.
*/
s3eResult ouyaControllerUnRegister(OuyaControllerEvent type, s3eCallback pCallback) run_on_os_thread
/*
* @brief Gives you the state of the given @a button on the given
* @a controller.
*/
int ouyaControllerGetButtonState(uint32 controller, uint32 button) run_on_os_thread
/*
* @brief Gives you the state of the given @axis on the given @a controller.
*/
float ouyaControllerGetAxis(uint32 controller, uint32 axis) run_on_os_thread