Kodi Development 22.0
for Binary and Script based Add-Ons
 
All Classes Functions Variables Typedefs Enumerations Enumerator Modules Pages
Loading...
Searching...
No Matches
game.h
1/*
2 * Copyright (C) 2014-2025 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#ifndef C_API_ADDONINSTANCE_GAME_H
10#define C_API_ADDONINSTANCE_GAME_H
11
12#include "../addon_base.h"
13
14#include <stddef.h> /* size_t */
15
16#ifdef __cplusplus
17extern "C"
18{
19#endif /* __cplusplus */
20
21 //============================================================================
53 //----------------------------------------------------------------------------
54
55 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
64
65 //============================================================================
70 typedef enum GAME_PCM_FORMAT
71 {
72 GAME_PCM_FORMAT_UNKNOWN,
73
77 //----------------------------------------------------------------------------
78
79 //============================================================================
149 //----------------------------------------------------------------------------
150
151 //============================================================================
157 {
158 GAME_PCM_FORMAT format;
159 const GAME_AUDIO_CHANNEL* channel_map;
160 } ATTR_PACKED game_stream_audio_properties;
161 //----------------------------------------------------------------------------
162
163 //============================================================================
169 {
171 const uint8_t* data;
172
174 size_t size;
175 } ATTR_PACKED game_stream_audio_packet;
176 //----------------------------------------------------------------------------
177
179
180 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
189
190 //============================================================================
208 //----------------------------------------------------------------------------
209
210 //============================================================================
229 //----------------------------------------------------------------------------
230
231 //============================================================================
238 {
241
243 unsigned int nominal_width;
244
246 unsigned int nominal_height;
247
253
255 unsigned int max_width;
256
258 unsigned int max_height;
259 } ATTR_PACKED game_stream_video_properties;
260 //----------------------------------------------------------------------------
261
262 //============================================================================
268 {
270 unsigned int width;
271
273 unsigned int height;
274
280
283
285 const uint8_t* data;
286
288 size_t size;
289 } ATTR_PACKED game_stream_video_packet;
290 //----------------------------------------------------------------------------
291
293
294 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
300
301 //============================================================================
327 //----------------------------------------------------------------------------
328
329 //==============================================================================
337 {
341
346 bool depth;
347
356
364
366 unsigned int version_major;
367
369 unsigned int version_minor;
370
383
386
387 } ATTR_PACKED game_hw_rendering_properties;
388 //------------------------------------------------------------------------------
389
390 //==============================================================================
397 {
398 char dummy; // Occupier for empty struct
400 //----------------------------------------------------------------------------
401
402 //============================================================================
406 {
408 uintptr_t framebuffer;
410 //----------------------------------------------------------------------------
411
412 //============================================================================
416 {
418 uintptr_t framebuffer;
420 //----------------------------------------------------------------------------
421
422 //============================================================================
425 typedef void (*game_proc_address_t)(void);
426 //----------------------------------------------------------------------------
427
429
430 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
436
437 //============================================================================
443 //----------------------------------------------------------------------------
444
445 //============================================================================
449 {
450 GAME_PIXEL_FORMAT format;
451 uint8_t* data;
452 size_t size;
454 //----------------------------------------------------------------------------
455
456 //============================================================================
462 //----------------------------------------------------------------------------
463
465
466 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
472
473 //============================================================================
493 //----------------------------------------------------------------------------
494
495 //============================================================================
521 //----------------------------------------------------------------------------
522
523 //============================================================================
540 //----------------------------------------------------------------------------
541
542 //============================================================================
569 //----------------------------------------------------------------------------
570
572
573 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
579
580 //============================================================================
595 //----------------------------------------------------------------------------
596
597 //============================================================================
616 //----------------------------------------------------------------------------
617
618 //============================================================================
663 //----------------------------------------------------------------------------
664
665 //============================================================================
667 typedef enum GAME_SIMD
668 {
670 GAME_SIMD_SSE = (1 << 0),
671
673 GAME_SIMD_SSE2 = (1 << 1),
674
676 GAME_SIMD_VMX = (1 << 2),
677
680
682 GAME_SIMD_AVX = (1 << 4),
683
685 GAME_SIMD_NEON = (1 << 5),
686
688 GAME_SIMD_SSE3 = (1 << 6),
689
691 GAME_SIMD_SSSE3 = (1 << 7),
692
694 GAME_SIMD_MMX = (1 << 8),
695
698
700 GAME_SIMD_SSE4 = (1 << 10),
701
703 GAME_SIMD_SSE42 = (1 << 11),
704
706 GAME_SIMD_AVX2 = (1 << 12),
707
709 GAME_SIMD_VFPU = (1 << 13),
710 } GAME_SIMD;
711 //----------------------------------------------------------------------------
712
714
715 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
742
743 //==============================================================================
745#define ROOT_PORT_ADDRESS "/"
746 //------------------------------------------------------------------------------
747
748 //==============================================================================
750#define DEFAULT_PORT_ID "1"
751 //------------------------------------------------------------------------------
752
753 //==============================================================================
755#define KEYBOARD_PORT_ID "keyboard"
756 //------------------------------------------------------------------------------
757
758 //==============================================================================
760#define MOUSE_PORT_ID "mouse"
761 //------------------------------------------------------------------------------
762
763 //==============================================================================
765#define DEFAULT_PORT_ADDRESS "/1"
766 //------------------------------------------------------------------------------
767
768 //==============================================================================
770#define KEYBOARD_PORT_ADDRESS "/keyboard"
771 //------------------------------------------------------------------------------
772
773 //==============================================================================
775#define MOUSE_PORT_ADDRESS "/mouse"
776 //------------------------------------------------------------------------------
777
778 //============================================================================
809 //----------------------------------------------------------------------------
810
811 //============================================================================
813 typedef enum GAME_KEY_MOD
814 {
817
820
823
826
829
832
835
838
841 } GAME_KEY_MOD;
842 //----------------------------------------------------------------------------
843
844 //============================================================================
860 //----------------------------------------------------------------------------
861
870 {
871 char* controller_id;
872 bool provides_input; // False for multitaps
873 char** digital_buttons;
874 unsigned int digital_button_count;
875 char** analog_buttons;
876 unsigned int analog_button_count;
877 char** analog_sticks;
878 unsigned int analog_stick_count;
879 char** accelerometers;
880 unsigned int accelerometer_count;
881 char** keys;
882 unsigned int key_count;
883 char** rel_pointers;
884 unsigned int rel_pointer_count;
885 char** abs_pointers;
886 unsigned int abs_pointer_count;
887 char** motors;
888 unsigned int motor_count;
889 } ATTR_PACKED game_controller_layout;
890
891 struct game_input_port;
892
893 //============================================================================
895 typedef struct game_input_device
896 {
898 const char* controller_id;
899
901 const char* port_address;
902
905
907 unsigned int port_count;
908 } ATTR_PACKED game_input_device;
909 //----------------------------------------------------------------------------
910
911 //============================================================================
914 typedef struct game_input_port
915 {
918
920 const char* port_id;
921
928
931
933 unsigned int device_count;
934 } ATTR_PACKED game_input_port;
935 //----------------------------------------------------------------------------
936
937 //============================================================================
944 typedef struct game_input_topology
945 {
948
950 unsigned int port_count;
951
954 } ATTR_PACKED game_input_topology;
955 //----------------------------------------------------------------------------
956
957 //============================================================================
960 {
963 } ATTR_PACKED game_digital_button_event;
964 //----------------------------------------------------------------------------
965
966 //============================================================================
969 {
972 } ATTR_PACKED game_analog_button_event;
973 //----------------------------------------------------------------------------
974
975 //============================================================================
977 typedef struct game_axis_event
978 {
980 float position;
981 } ATTR_PACKED game_axis_event;
982 //----------------------------------------------------------------------------
983
984 //============================================================================
991 {
993 float x;
994
996 float y;
997 } ATTR_PACKED game_analog_stick_event;
998 //----------------------------------------------------------------------------
999
1000 //============================================================================
1003 {
1005 float x;
1006
1008 float y;
1009
1011 float z;
1012 } ATTR_PACKED game_accelerometer_event;
1013 //----------------------------------------------------------------------------
1014
1015 //============================================================================
1017 typedef struct game_key_event
1018 {
1021
1027 uint32_t unicode;
1028
1031 } ATTR_PACKED game_key_event;
1032 //----------------------------------------------------------------------------
1033
1034 //============================================================================
1037 {
1039 int x;
1040
1042 int y;
1043 } ATTR_PACKED game_rel_pointer_event;
1044 //----------------------------------------------------------------------------
1045
1046 //============================================================================
1049 {
1052
1054 float x;
1055
1057 float y;
1058 } ATTR_PACKED game_abs_pointer_event;
1059 //----------------------------------------------------------------------------
1060
1061 //============================================================================
1063 typedef struct game_motor_event
1064 {
1067 } ATTR_PACKED game_motor_event;
1068 //----------------------------------------------------------------------------
1069
1070 //============================================================================
1072 typedef struct game_input_event
1073 {
1076
1078 const char* controller_id;
1079
1082
1084 const char* port_address;
1085
1087 const char* feature_name;
1088
1089 union
1090 {
1093
1096
1098 struct game_axis_event axis;
1099
1102
1105
1107 struct game_key_event key;
1108
1111
1114
1116 struct game_motor_event motor;
1117 };
1118 } ATTR_PACKED game_input_event;
1119 //----------------------------------------------------------------------------
1120
1122
1123 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1129
1130 //============================================================================
1134 {
1136 double fps;
1137
1140 };
1141 //----------------------------------------------------------------------------
1142
1144
1145 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1146
1152 typedef struct AddonProps_Game
1153 {
1158
1162 const char** proxy_dll_paths;
1163
1167 unsigned int proxy_dll_count;
1168
1176
1181
1189
1194
1198 const char** extensions;
1199
1203 unsigned int extension_count;
1205
1206 typedef void* KODI_GAME_STREAM_HANDLE;
1207
1211 struct AddonInstance_Game;
1212
1219 {
1220 KODI_HANDLE kodiInstance;
1221
1222 bool (*EnableHardwareRendering)(void*, const game_hw_rendering_properties*);
1223 void (*CloseGame)(KODI_HANDLE kodiInstance);
1224 KODI_GAME_STREAM_HANDLE (*OpenStream)(KODI_HANDLE, const struct game_stream_properties*);
1225 bool (*GetStreamBuffer)(KODI_HANDLE,
1226 KODI_GAME_STREAM_HANDLE,
1227 unsigned int,
1228 unsigned int,
1229 struct game_stream_buffer*);
1230 void (*AddStreamData)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, const struct game_stream_packet*);
1231 void (*ReleaseStreamBuffer)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, struct game_stream_buffer*);
1232 void (*CloseStream)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE);
1233 game_proc_address_t (*HwGetProcAddress)(KODI_HANDLE kodiInstance, const char* symbol);
1234 bool (*InputEvent)(KODI_HANDLE kodiInstance, const struct game_input_event* event);
1236
1243 {
1244 KODI_HANDLE addonInstance;
1245
1246 GAME_ERROR(__cdecl* LoadGame)(const struct AddonInstance_Game*, const char*);
1247 GAME_ERROR(__cdecl* LoadGameSpecial)
1248 (const struct AddonInstance_Game*, enum SPECIAL_GAME_TYPE, const char**, size_t);
1249 GAME_ERROR(__cdecl* LoadStandalone)(const struct AddonInstance_Game*);
1250 GAME_ERROR(__cdecl* UnloadGame)(const struct AddonInstance_Game*);
1251 GAME_ERROR(__cdecl* GetGameTiming)
1252 (const struct AddonInstance_Game*, struct game_system_timing*);
1253 GAME_REGION(__cdecl* GetRegion)(const struct AddonInstance_Game*);
1254 bool(__cdecl* RequiresGameLoop)(const struct AddonInstance_Game*);
1255 GAME_ERROR(__cdecl* RunFrame)(const struct AddonInstance_Game*);
1256 GAME_ERROR(__cdecl* Reset)(const struct AddonInstance_Game*);
1257 GAME_ERROR(__cdecl* HwContextReset)(const struct AddonInstance_Game*);
1258 GAME_ERROR(__cdecl* HwContextDestroy)(const struct AddonInstance_Game*);
1259 bool(__cdecl* HasFeature)(const struct AddonInstance_Game*, const char*, const char*);
1260 game_input_topology*(__cdecl* GetTopology)(const struct AddonInstance_Game*);
1261 void(__cdecl* FreeTopology)(const struct AddonInstance_Game*, struct game_input_topology*);
1262 void(__cdecl* SetControllerLayouts)(const struct AddonInstance_Game*,
1263 const struct game_controller_layout*,
1264 unsigned int);
1265 bool(__cdecl* EnableKeyboard)(const struct AddonInstance_Game*, bool, const char*);
1266 bool(__cdecl* EnableMouse)(const struct AddonInstance_Game*, bool, const char*);
1267 bool(__cdecl* ConnectController)(const struct AddonInstance_Game*,
1268 bool,
1269 const char*,
1270 const char*);
1271 bool(__cdecl* InputEvent)(const struct AddonInstance_Game*, const struct game_input_event*);
1272 size_t(__cdecl* SerializeSize)(const struct AddonInstance_Game*);
1273 GAME_ERROR(__cdecl* Serialize)(const struct AddonInstance_Game*, uint8_t*, size_t);
1274 GAME_ERROR(__cdecl* Deserialize)(const struct AddonInstance_Game*, const uint8_t*, size_t);
1275 GAME_ERROR(__cdecl* CheatReset)(const struct AddonInstance_Game*);
1276 GAME_ERROR(__cdecl* GetMemory)
1277 (const struct AddonInstance_Game*, enum GAME_MEMORY, uint8_t**, size_t*);
1278 GAME_ERROR(__cdecl* SetCheat)
1279 (const struct AddonInstance_Game*, unsigned int, bool, const char*);
1280 GAME_ERROR(__cdecl* RCGenerateHashFromFile)
1281 (const AddonInstance_Game*, char**, unsigned int, const char*);
1282 GAME_ERROR(__cdecl* RCGetGameIDUrl)(const AddonInstance_Game*, char**, const char*);
1283 GAME_ERROR(__cdecl* RCGetPatchFileUrl)
1284 (const AddonInstance_Game*, char**, const char*, const char*, unsigned int);
1285 GAME_ERROR(__cdecl* RCPostRichPresenceUrl)
1286 (const AddonInstance_Game*,
1287 char**,
1288 char**,
1289 const char*,
1290 const char*,
1291 unsigned int,
1292 const char*);
1293 GAME_ERROR(__cdecl* RCEnableRichPresence)(const AddonInstance_Game*, const char*);
1294 GAME_ERROR(__cdecl* RCGetRichPresenceEvaluation)
1295 (const AddonInstance_Game*, char**, unsigned int);
1296 GAME_ERROR(__cdecl* RCResetRuntime)(const AddonInstance_Game*);
1297 void(__cdecl* FreeString)(const AddonInstance_Game*, char*);
1299
1305 typedef struct AddonInstance_Game
1306 {
1307 struct AddonProps_Game* props;
1308 struct AddonToKodiFuncTable_Game* toKodi;
1309 struct KodiToAddonFuncTable_Game* toAddon;
1311
1312#ifdef __cplusplus
1313}
1314#endif /* __cplusplus */
1315
1316#endif /* !C_API_ADDONINSTANCE_GAME_H */
const uint8_t * data
Pointer to the audio stream data given to Kodi.
Definition game.h:171
size_t size
Size of the data array.
Definition game.h:174
GAME_AUDIO_CHANNEL
Audio channel
Definition game.h:85
GAME_PCM_FORMAT
Stream Format
Definition game.h:71
@ GAME_CH_TFC
Channel top front center.
Definition game.h:129
@ GAME_CH_FL
Channel front left.
Definition game.h:90
@ GAME_CH_BL
Channel back left.
Definition game.h:102
@ GAME_CH_TBR
Channel top back right.
Definition game.h:138
@ GAME_CH_FC
Channel front center.
Definition game.h:96
@ GAME_CH_BLOC
Channel back left over center.
Definition game.h:144
@ GAME_CH_TFL
Channel top front left.
Definition game.h:123
@ GAME_CH_NULL
Channel list terminator.
Definition game.h:87
@ GAME_CH_TBC
Channel top back center.
Definition game.h:141
@ GAME_CH_SR
Channel surround/side right.
Definition game.h:120
@ GAME_CH_TFR
Channel top front right.
Definition game.h:126
@ GAME_CH_FR
Channel front right.
Definition game.h:93
@ GAME_CH_BC
Channel back center.
Definition game.h:114
@ GAME_CH_SL
Channel surround/side left.
Definition game.h:117
@ GAME_CH_LFE
Channel low frequency effects / subwoofer.
Definition game.h:99
@ GAME_CH_BROC
Channel back right over center.
Definition game.h:147
@ GAME_CH_TC
Channel top center.
Definition game.h:132
@ GAME_CH_FLOC
Channel front left over center.
Definition game.h:108
@ GAME_CH_FROC
Channel front right over center.
Definition game.h:111
@ GAME_CH_TBL
Channel top back left.
Definition game.h:135
@ GAME_CH_BR
Channel back right.
Definition game.h:105
@ GAME_PCM_FORMAT_S16NE
S16NE sample format.
Definition game.h:75
Audio stream packet
Definition game.h:169
Game audio stream properties
Definition game.h:157
double sample_rate
Sampling rate of audio.
Definition game.h:1139
double fps
FPS of video content.
Definition game.h:1136
Game system timing.
Definition game.h:1134
GAME_SIMD
ID values for SIMD CPU features
Definition game.h:668
GAME_REGION
Game region definition
Definition game.h:585
SPECIAL_GAME_TYPE
Special game types passed into game_load_game_special().
Definition game.h:603
GAME_MEMORY
Game Memory
Definition game.h:622
@ GAME_SIMD_VFPU
SIMD CPU VFPU.
Definition game.h:709
@ GAME_SIMD_VMX128
SIMD CPU VMX128.
Definition game.h:679
@ GAME_SIMD_SSE
SIMD CPU SSE.
Definition game.h:670
@ GAME_SIMD_SSE4
SIMD CPU SSE4.
Definition game.h:700
@ GAME_SIMD_NEON
SIMD CPU NEON.
Definition game.h:685
@ GAME_SIMD_AVX2
SIMD CPU AVX2.
Definition game.h:706
@ GAME_SIMD_SSE42
SIMD CPU SSE42.
Definition game.h:703
@ GAME_SIMD_SSSE3
SIMD CPU SSSE3.
Definition game.h:691
@ GAME_SIMD_SSE2
SIMD CPU SSE2.
Definition game.h:673
@ GAME_SIMD_SSE3
SIMD CPU SSE3.
Definition game.h:688
@ GAME_SIMD_AVX
SIMD CPU AVX.
Definition game.h:682
@ GAME_SIMD_MMXEXT
SIMD CPU MMXEXT.
Definition game.h:697
@ GAME_SIMD_MMX
SIMD CPU MMX.
Definition game.h:694
@ GAME_SIMD_VMX
SIMD CPU VMX.
Definition game.h:676
@ GAME_REGION_NTSC
Game region NTSC.
Definition game.h:590
@ GAME_REGION_PAL
Game region PAL.
Definition game.h:593
@ GAME_REGION_UNKNOWN
Game region unknown.
Definition game.h:587
@ SPECIAL_GAME_TYPE_SUPER_GAME_BOY
Game Type super game boy.
Definition game.h:614
@ SPECIAL_GAME_TYPE_BSX
Game Type BSX.
Definition game.h:605
@ SPECIAL_GAME_TYPE_BSX_SLOTTED
Game Type BSX slotted.
Definition game.h:608
@ SPECIAL_GAME_TYPE_SUFAMI_TURBO
Game Type sufami turbo.
Definition game.h:611
@ GAME_MEMORY_SNES_SUFAMI_TURBO_A_RAM
Special memory type.
Definition game.h:652
@ GAME_MEMORY_VIDEO_RAM
Video ram lets a frontend peek into a game systems video RAM (VRAM)
Definition game.h:643
@ GAME_MEMORY_SNES_SUFAMI_TURBO_B_RAM
Special memory type.
Definition game.h:655
@ GAME_MEMORY_SNES_GAME_BOY_RTC
Special memory type.
Definition game.h:661
@ GAME_MEMORY_SNES_BSX_PRAM
Special memory type.
Definition game.h:649
@ GAME_MEMORY_MASK
Passed to game_get_memory_data/size(). If the memory type doesn't apply to the implementation NULL/0 ...
Definition game.h:625
@ GAME_MEMORY_SAVE_RAM
Regular save ram.
Definition game.h:632
@ GAME_MEMORY_SYSTEM_RAM
System ram lets a frontend peek into a game systems main RAM.
Definition game.h:640
@ GAME_MEMORY_SNES_BSX_RAM
Special memory type.
Definition game.h:646
@ GAME_MEMORY_RTC
Some games have a built-in clock to keep track of time.
Definition game.h:637
@ GAME_MEMORY_SNES_GAME_BOY_RAM
Special memory type.
Definition game.h:658
bool cache_context
If true, the frontend will go to great lengths to avoid resetting the context in scenarios like toggl...
Definition game.h:382
unsigned int version_minor
Minor version number for the core GL context or GLES 3.1+.
Definition game.h:369
bool depth
Set to true if render buffers should have a depth component attached.
Definition game.h:346
unsigned int version_major
Major version number for the core GL context or GLES 3.1+.
Definition game.h:366
bool bottom_left_origin
Use the conventional bottom-left origin.
Definition game.h:363
GAME_HW_CONTEXT_TYPE context_type
The API to use.
Definition game.h:340
bool debug_context
Creates a debug context.
Definition game.h:385
bool stencil
Set to true if stencil buffers should be attached.
Definition game.h:355
void(* game_proc_address_t)(void)
Hardware framebuffer process function address
Definition game.h:425
GAME_HW_CONTEXT_TYPE
Hardware framebuffer type
Definition game.h:305
@ GAME_HW_CONTEXT_OPENGLES2
OpenGL ES 2.0.
Definition game.h:313
@ GAME_HW_CONTEXT_OPENGL_CORE
Modern desktop core GL context. Use the major and minor fields to set the GL version.
Definition game.h:316
@ GAME_HW_CONTEXT_VULKAN
Vulkan.
Definition game.h:325
@ GAME_HW_CONTEXT_OPENGLES_VERSION
OpenGL ES 3.1+. Set major/minor fields.
Definition game.h:322
@ GAME_HW_CONTEXT_OPENGLES3
OpenGL ES 3.0.
Definition game.h:319
@ GAME_HW_CONTEXT_NONE
No context.
Definition game.h:307
@ GAME_HW_CONTEXT_OPENGL
OpenGL 2.x. The driver can choose to use the latest compatibility context.
Definition game.h:310
Hardware rendering properties
Definition game.h:337
Hardware framebuffer buffer
Definition game.h:406
Hardware framebuffer packet
Definition game.h:416
Hardware framebuffer properties
Definition game.h:397
int y
The relative Y position of the pointer.
Definition game.h:1042
struct game_accelerometer_event accelerometer
Accelerometer event.
bool pressed
True if the button is pressed, false if it is released.
Definition game.h:962
const char * feature_name
The name of the feature that generated the event.
Definition game.h:1087
GAME_INPUT_EVENT_SOURCE type
The type of input event.
Definition game.h:1075
unsigned int port_count
The number of ports in the available ports list.
Definition game.h:907
struct game_key_event key
Key event.
game_input_port * ports
The list of ports on the virtual game console.
Definition game.h:947
struct game_axis_event axis
Axis event.
struct game_analog_button_event analog_button
Analog button event.
bool force_connected
Flag to prevent a port from being disconnected.
Definition game.h:927
struct game_motor_event motor
Motor vibration event.
unsigned int device_count
The number of devices in the accepted devices list.
Definition game.h:933
int x
The relative X position of the pointer.
Definition game.h:1039
struct game_analog_stick_event analog_stick
Analog stick event.
GAME_PORT_TYPE type
The type of port.
Definition game.h:917
float position
The position of the axis, from -1.0 to 1.0.
Definition game.h:980
struct game_input_port * available_ports
The list of ports that the device can be connected to.
Definition game.h:904
float magnitude
The magnitude of the button press, from 0.0 to 1.0.
Definition game.h:971
const char * controller_id
ID used in the Kodi controller API, e.g. game.controller.default
Definition game.h:898
struct game_digital_button_event digital_button
Digital button event.
float y
The position of the stick along the Y axis, from -1.0 to 1.0.
Definition game.h:996
const char * port_address
The address of the port that the device is connected to.
Definition game.h:901
uint32_t unicode
If the keypress generates a printing character.
Definition game.h:1027
GAME_KEY_MOD modifiers
Modifier keys pressed with the event key.
Definition game.h:1030
GAME_PORT_TYPE port_type
The type of port that the controller is connected to.
Definition game.h:1081
float x
The position of the stick along the X axis, from -1.0 to 1.0.
Definition game.h:993
int player_limit
A limit on the number of input-providing devices, or -1 for no limit.
Definition game.h:953
const char * port_id
Required for GAME_PORT_CONTROLLER type.
Definition game.h:920
struct game_abs_pointer_event abs_pointer
Absolute pointer event.
game_input_device * accepted_devices
The list of devices that can be connected to the port.
Definition game.h:930
struct game_rel_pointer_event rel_pointer
Relative pointer event.
float z
The accelerometer Z axis, from -1.0 to 1.0.
Definition game.h:1011
GAME_INPUT_EVENT_SOURCE
Type of input event.
Definition game.h:781
GAME_KEY_MOD
A modifier key pressed to give another key a special meaning.
Definition game.h:814
GAME_PORT_TYPE
Type of port on the virtual game console.
Definition game.h:847
@ GAME_INPUT_EVENT_DIGITAL_BUTTON
Digital button press or release.
Definition game.h:783
@ GAME_INPUT_EVENT_ANALOG_STICK
Analog stick motion.
Definition game.h:792
@ GAME_INPUT_EVENT_ABSOLUTE_POINTER
Absolute pointer motion.
Definition game.h:804
@ GAME_INPUT_EVENT_RELATIVE_POINTER
Relative pointer motion.
Definition game.h:801
@ GAME_INPUT_EVENT_MOTOR
Motor vibration.
Definition game.h:807
@ GAME_INPUT_EVENT_ACCELEROMETER
Accelerometer motion.
Definition game.h:795
@ GAME_INPUT_EVENT_KEY
Key press or release.
Definition game.h:798
@ GAME_INPUT_EVENT_AXIS
Axis motion.
Definition game.h:789
@ GAME_INPUT_EVENT_ANALOG_BUTTON
Analog button motion.
Definition game.h:786
@ GAME_KEY_MOD_ALT
Alt key.
Definition game.h:825
@ GAME_KEY_MOD_CAPSLOCK
Caps Lock key.
Definition game.h:837
@ GAME_KEY_MOD_CTRL
Control key.
Definition game.h:822
@ GAME_KEY_MOD_META
Meta key.
Definition game.h:828
@ GAME_KEY_MOD_SCROLLOCK
Scroll Lock key.
Definition game.h:840
@ GAME_KEY_MOD_NUMLOCK
Num Lock key.
Definition game.h:834
@ GAME_KEY_MOD_SUPER
Windows key.
Definition game.h:831
@ GAME_KEY_MOD_NONE
No modifier key.
Definition game.h:816
@ GAME_KEY_MOD_SHIFT
Shift key.
Definition game.h:819
@ GAME_PORT_MOUSE
Game port mouse.
Definition game.h:855
@ GAME_PORT_CONTROLLER
Game port controller.
Definition game.h:858
@ GAME_PORT_KEYBOARD
Game port Keyboard.
Definition game.h:852
@ GAME_PORT_UNKNOWN
Game port unknown.
Definition game.h:849
An absolute pointer event, such as a touchscreen or tablet motion.
Definition game.h:1049
An accelerometer event.
Definition game.h:1003
An analog button event, such as a trigger press or release.
Definition game.h:969
An analog stick event, such as a joystick's motion.
Definition game.h:991
An axis event, such as a joystick or accelerometer.
Definition game.h:978
"C" Game add-on controller layout.
Definition game.h:870
A digital button event, such as a button press or release.
Definition game.h:960
Device that can provide input.
Definition game.h:896
An input event.
Definition game.h:1073
Port that can provide input.
Definition game.h:915
The input topology is the possible ways to connect input devices.
Definition game.h:945
A key event, such as a key press or release.
Definition game.h:1018
A motor vibration event.
Definition game.h:1064
A relative pointer event, such as a mouse motion.
Definition game.h:1037
game_stream_video_packet game_stream_sw_framebuffer_packet
Software framebuffer packet
Definition game.h:461
game_stream_video_properties game_stream_sw_framebuffer_properties
Game software framebuffer stream properties
Definition game.h:442
Software framebuffer type
Definition game.h:449
GAME_STREAM_TYPE type
The stream type.
Definition game.h:504
game_stream_video_properties video
The video stream properties.
game_stream_sw_framebuffer_properties sw_framebuffer
The software framebuffer properties.
game_stream_audio_properties audio
The audio stream properties.
game_stream_hw_framebuffer_properties hw_framebuffer
The hardware framebuffer properties.
GAME_STREAM_TYPE
Game stream types
Definition game.h:477
@ GAME_STREAM_VIDEO
Video stream.
Definition game.h:485
@ GAME_STREAM_AUDIO
Audio stream.
Definition game.h:482
@ GAME_STREAM_HW_FRAMEBUFFER
Hardware framebuffer.
Definition game.h:488
@ GAME_STREAM_UNKNOWN
Unknown.
Definition game.h:479
@ GAME_STREAM_SW_FRAMEBUFFER
Software framebuffer.
Definition game.h:491
Stream buffers for hardware rendering and zero-copy support
Definition game.h:527
Stream packet and ephemeral metadata
Definition game.h:550
Immutable stream metadata
Definition game.h:502
float display_aspect_ratio
Display aspect ratio (DAR) to use when showing the video frame.
Definition game.h:279
const uint8_t * data
Pointer to the video stream data given to Kodi.
Definition game.h:285
size_t size
Size of the data array.
Definition game.h:288
unsigned int nominal_width
The nominal width, in pixels.
Definition game.h:243
unsigned int max_height
The maximum height, in pixels.
Definition game.h:258
GAME_VIDEO_ROTATION rotation
Video rotation angle defined by GAME_VIDEO_ROTATION.
Definition game.h:282
unsigned int height
Video height, in pixels.
Definition game.h:273
unsigned int max_width
The maximum width, in pixels.
Definition game.h:255
unsigned int width
Video width, in pixels.
Definition game.h:270
float nominal_display_aspect_ratio
The nominal display aspect ratio (DAR) used to show the video frame.
Definition game.h:252
GAME_PIXEL_FORMAT format
The stream's pixel format.
Definition game.h:240
unsigned int nominal_height
The nominal height, in pixels.
Definition game.h:246
GAME_PIXEL_FORMAT
Pixel format
Definition game.h:196
GAME_VIDEO_ROTATION
Video rotation orientation
Definition game.h:216
@ GAME_PIXEL_FORMAT_RGB565
RGB565 Format.
Definition game.h:203
@ GAME_PIXEL_FORMAT_0RGB1555
0RGB1555 Format
Definition game.h:206
@ GAME_PIXEL_FORMAT_0RGB8888
0RGB8888 Format
Definition game.h:200
@ GAME_VIDEO_ROTATION_180_CCW
Rotate 180° counterclockwise.
Definition game.h:224
@ GAME_VIDEO_ROTATION_0
0° without rotation
Definition game.h:218
@ GAME_VIDEO_ROTATION_90_CCW
Rotate 90° counterclockwise.
Definition game.h:221
@ GAME_VIDEO_ROTATION_270_CCW
Rotate 270° counterclockwise.
Definition game.h:227
Video stream packet
Definition game.h:268
Game video stream properties
Definition game.h:238
GAME_ERROR
Game add-on error codes
Definition game.h:28
@ GAME_ERROR_FAILED
The command failed.
Definition game.h:45
@ GAME_ERROR_REJECTED
The command was rejected by the game client.
Definition game.h:39
@ GAME_ERROR_INVALID_PARAMETERS
The parameters of the called method are invalid for this operation.
Definition game.h:42
@ GAME_ERROR_UNKNOWN
An unknown error occurred.
Definition game.h:33
@ GAME_ERROR_NO_ERROR
No error occurred.
Definition game.h:30
@ GAME_ERROR_RESTRICTED
Game requires restricted resources.
Definition game.h:51
@ GAME_ERROR_NOT_LOADED
No game is loaded.
Definition game.h:48
@ GAME_ERROR_NOT_IMPLEMENTED
The method called by the frontend is not implemented.
Definition game.h:36
Game instance.
Definition game.h:1306
Game properties.
Definition game.h:1153
const char ** resource_directories
The "system" directories of the frontend.
Definition game.h:1175
unsigned int proxy_dll_count
Number of proxy DLL paths provided.
Definition game.h:1167
const char * profile_directory
The writable directory of the frontend.
Definition game.h:1188
const char * game_client_dll_path
The path of the game client being loaded.
Definition game.h:1157
unsigned int extension_count
Number of extensions provided.
Definition game.h:1203
bool supports_vfs
The value of the <supports_vfs> property from addon.xml.
Definition game.h:1193
const char ** proxy_dll_paths
Paths to proxy DLLs used to load the game client.
Definition game.h:1162
const char ** extensions
The extensions in the <extensions> property from addon.xml.
Definition game.h:1198
unsigned int resource_directory_count
Number of resource directories provided.
Definition game.h:1180
Game callbacks.
Definition game.h:1219
Game function hooks.
Definition game.h:1243