kodi
game.h
1 /*
2  * Copyright (C) 2014-2024 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
17 extern "C"
18 {
19 #endif /* __cplusplus */
20 
21  //============================================================================
27  typedef enum GAME_ERROR
28  {
30  GAME_ERROR_NO_ERROR,
31 
33  GAME_ERROR_UNKNOWN,
34 
36  GAME_ERROR_NOT_IMPLEMENTED,
37 
39  GAME_ERROR_REJECTED,
40 
42  GAME_ERROR_INVALID_PARAMETERS,
43 
45  GAME_ERROR_FAILED,
46 
48  GAME_ERROR_NOT_LOADED,
49 
51  GAME_ERROR_RESTRICTED,
52  } GAME_ERROR;
53  //----------------------------------------------------------------------------
54 
55  //--==----==----==----==----==----==----==----==----==----==----==----==----==--
64 
65  //============================================================================
70  typedef enum GAME_PCM_FORMAT
71  {
72  GAME_PCM_FORMAT_UNKNOWN,
73 
77  //----------------------------------------------------------------------------
78 
79  //============================================================================
84  typedef enum GAME_AUDIO_CHANNEL
85  {
88 
91 
94 
97 
100 
103 
106 
109 
112 
115 
118 
121 
124 
127 
130 
133 
136 
139 
142 
145 
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  //============================================================================
195  typedef enum GAME_PIXEL_FORMAT
196  {
197  GAME_PIXEL_FORMAT_UNKNOWN,
198 
201 
204 
208  //----------------------------------------------------------------------------
209 
210  //============================================================================
215  typedef enum GAME_VIDEO_ROTATION
216  {
219 
222 
225 
229  //----------------------------------------------------------------------------
230 
231  //============================================================================
237  {
239  GAME_PIXEL_FORMAT format;
240 
242  unsigned int nominal_width;
243 
245  unsigned int nominal_height;
246 
248  unsigned int max_width;
249 
251  unsigned int max_height;
252 
257  } ATTR_PACKED game_stream_video_properties;
258  //----------------------------------------------------------------------------
259 
260  //============================================================================
266  {
268  unsigned int width;
269 
271  unsigned int height;
272 
274  GAME_VIDEO_ROTATION rotation;
275 
277  const uint8_t* data;
278 
280  size_t size;
281  } ATTR_PACKED game_stream_video_packet;
282  //----------------------------------------------------------------------------
283 
285 
286  //--==----==----==----==----==----==----==----==----==----==----==----==----==--
292 
293  //============================================================================
296  typedef enum GAME_HW_CONTEXT_TYPE
297  {
300 
303 
306 
309 
312 
315 
319  //----------------------------------------------------------------------------
320 
321  //============================================================================
325  {
328  GAME_HW_CONTEXT_TYPE context_type;
329 
334  bool depth;
335 
343  bool stencil;
344 
352 
354  unsigned int version_major;
355 
357  unsigned int version_minor;
358 
371 
375  //----------------------------------------------------------------------------
376 
377  //============================================================================
381  {
383  uintptr_t framebuffer;
384  } ATTR_PACKED game_stream_hw_framebuffer_buffer;
385  //----------------------------------------------------------------------------
386 
387  //============================================================================
391  {
393  uintptr_t framebuffer;
394  } ATTR_PACKED game_stream_hw_framebuffer_packet;
395  //----------------------------------------------------------------------------
396 
397  //============================================================================
400  typedef void (*game_proc_address_t)(void);
401  //----------------------------------------------------------------------------
402 
404 
405  //--==----==----==----==----==----==----==----==----==----==----==----==----==--
411 
412  //============================================================================
417  typedef game_stream_video_properties game_stream_sw_framebuffer_properties;
418  //----------------------------------------------------------------------------
419 
420  //============================================================================
424  {
425  GAME_PIXEL_FORMAT format;
426  uint8_t* data;
427  size_t size;
428  } ATTR_PACKED game_stream_sw_framebuffer_buffer;
429  //----------------------------------------------------------------------------
430 
431  //============================================================================
436  typedef game_stream_video_packet game_stream_sw_framebuffer_packet;
437  //----------------------------------------------------------------------------
438 
440 
441  //--==----==----==----==----==----==----==----==----==----==----==----==----==--
447 
448  //============================================================================
451  typedef enum GAME_STREAM_TYPE
452  {
455 
458 
461 
464 
468  //----------------------------------------------------------------------------
469 
470  //============================================================================
476  typedef struct game_stream_properties
477  {
479  GAME_STREAM_TYPE type;
480 
481  union
482  {
484  game_stream_audio_properties audio;
485 
487  game_stream_video_properties video;
488 
490  game_stream_hw_framebuffer_properties hw_framebuffer;
491 
493  game_stream_sw_framebuffer_properties sw_framebuffer;
494  };
495  } ATTR_PACKED game_stream_properties;
496  //----------------------------------------------------------------------------
497 
498  //============================================================================
501  typedef struct game_stream_buffer
502  {
504  GAME_STREAM_TYPE type;
505 
506  union
507  {
509  game_stream_hw_framebuffer_buffer hw_framebuffer;
510 
512  game_stream_sw_framebuffer_buffer sw_framebuffer;
513  };
514  } ATTR_PACKED game_stream_buffer;
515  //----------------------------------------------------------------------------
516 
517  //============================================================================
524  typedef struct game_stream_packet
525  {
527  GAME_STREAM_TYPE type;
528 
529  union
530  {
532  game_stream_audio_packet audio;
533 
535  game_stream_video_packet video;
536 
538  game_stream_hw_framebuffer_packet hw_framebuffer;
539 
541  game_stream_sw_framebuffer_packet sw_framebuffer;
542  };
543  } ATTR_PACKED game_stream_packet;
544  //----------------------------------------------------------------------------
545 
547 
548  //--==----==----==----==----==----==----==----==----==----==----==----==----==--
554 
555  //============================================================================
559  typedef enum GAME_REGION
560  {
563 
566 
569  } GAME_REGION;
570  //----------------------------------------------------------------------------
571 
572  //============================================================================
577  typedef enum SPECIAL_GAME_TYPE
578  {
581 
584 
587 
591  //----------------------------------------------------------------------------
592 
593  //============================================================================
596  typedef enum GAME_MEMORY
597  {
601 
608 
613 
616 
619 
622 
625 
628 
631 
634 
637  } GAME_MEMORY;
638  //----------------------------------------------------------------------------
639 
640  //============================================================================
642  typedef enum GAME_SIMD
643  {
645  GAME_SIMD_SSE = (1 << 0),
646 
648  GAME_SIMD_SSE2 = (1 << 1),
649 
651  GAME_SIMD_VMX = (1 << 2),
652 
654  GAME_SIMD_VMX128 = (1 << 3),
655 
657  GAME_SIMD_AVX = (1 << 4),
658 
660  GAME_SIMD_NEON = (1 << 5),
661 
663  GAME_SIMD_SSE3 = (1 << 6),
664 
666  GAME_SIMD_SSSE3 = (1 << 7),
667 
669  GAME_SIMD_MMX = (1 << 8),
670 
672  GAME_SIMD_MMXEXT = (1 << 9),
673 
675  GAME_SIMD_SSE4 = (1 << 10),
676 
678  GAME_SIMD_SSE42 = (1 << 11),
679 
681  GAME_SIMD_AVX2 = (1 << 12),
682 
684  GAME_SIMD_VFPU = (1 << 13),
685  } GAME_SIMD;
686  //----------------------------------------------------------------------------
687 
689 
690  //--==----==----==----==----==----==----==----==----==----==----==----==----==--
717 
718  //==============================================================================
720 #define ROOT_PORT_ADDRESS "/"
721  //------------------------------------------------------------------------------
722 
723  //==============================================================================
725 #define DEFAULT_PORT_ID "1"
726  //------------------------------------------------------------------------------
727 
728  //==============================================================================
730 #define KEYBOARD_PORT_ID "keyboard"
731  //------------------------------------------------------------------------------
732 
733  //==============================================================================
735 #define MOUSE_PORT_ID "mouse"
736  //------------------------------------------------------------------------------
737 
738  //==============================================================================
740 #define DEFAULT_PORT_ADDRESS "/1"
741  //------------------------------------------------------------------------------
742 
743  //==============================================================================
745 #define KEYBOARD_PORT_ADDRESS "/keyboard"
746  //------------------------------------------------------------------------------
747 
748  //==============================================================================
750 #define MOUSE_PORT_ADDRESS "/mouse"
751  //------------------------------------------------------------------------------
752 
753  //============================================================================
756  {
759 
762 
765 
768 
771 
774 
777 
780 
784  //----------------------------------------------------------------------------
785 
786  //============================================================================
788  typedef enum GAME_KEY_MOD
789  {
792 
795 
798 
801 
804 
807 
810 
813 
816  } GAME_KEY_MOD;
817  //----------------------------------------------------------------------------
818 
819  //============================================================================
821  typedef enum GAME_PORT_TYPE
822  {
825 
828 
831 
834  } GAME_PORT_TYPE;
835  //----------------------------------------------------------------------------
836 
844  typedef struct game_controller_layout
845  {
846  char* controller_id;
847  bool provides_input; // False for multitaps
848  char** digital_buttons;
849  unsigned int digital_button_count;
850  char** analog_buttons;
851  unsigned int analog_button_count;
852  char** analog_sticks;
853  unsigned int analog_stick_count;
854  char** accelerometers;
855  unsigned int accelerometer_count;
856  char** keys;
857  unsigned int key_count;
858  char** rel_pointers;
859  unsigned int rel_pointer_count;
860  char** abs_pointers;
861  unsigned int abs_pointer_count;
862  char** motors;
863  unsigned int motor_count;
864  } ATTR_PACKED game_controller_layout;
865 
866  struct game_input_port;
867 
868  //============================================================================
870  typedef struct game_input_device
871  {
873  const char* controller_id;
874 
876  const char* port_address;
877 
880 
882  unsigned int port_count;
883  } ATTR_PACKED game_input_device;
884  //----------------------------------------------------------------------------
885 
886  //============================================================================
889  typedef struct game_input_port
890  {
892  GAME_PORT_TYPE type;
893 
895  const char* port_id;
896 
903 
905  game_input_device* accepted_devices;
906 
908  unsigned int device_count;
909  } ATTR_PACKED game_input_port;
910  //----------------------------------------------------------------------------
911 
912  //============================================================================
919  typedef struct game_input_topology
920  {
922  game_input_port* ports;
923 
925  unsigned int port_count;
926 
929  } ATTR_PACKED game_input_topology;
930  //----------------------------------------------------------------------------
931 
932  //============================================================================
935  {
937  bool pressed;
938  } ATTR_PACKED game_digital_button_event;
939  //----------------------------------------------------------------------------
940 
941  //============================================================================
944  {
946  float magnitude;
947  } ATTR_PACKED game_analog_button_event;
948  //----------------------------------------------------------------------------
949 
950  //============================================================================
952  typedef struct game_axis_event
953  {
955  float position;
956  } ATTR_PACKED game_axis_event;
957  //----------------------------------------------------------------------------
958 
959  //============================================================================
964  typedef struct game_analog_stick_event
965  {
967  float x;
968 
970  float y;
971  } ATTR_PACKED game_analog_stick_event;
972  //----------------------------------------------------------------------------
973 
974  //============================================================================
977  {
979  float x;
980 
982  float y;
983 
985  float z;
986  } ATTR_PACKED game_accelerometer_event;
987  //----------------------------------------------------------------------------
988 
989  //============================================================================
991  typedef struct game_key_event
992  {
994  bool pressed;
995 
1001  uint32_t unicode;
1002 
1005  } ATTR_PACKED game_key_event;
1006  //----------------------------------------------------------------------------
1007 
1008  //============================================================================
1010  typedef struct game_rel_pointer_event
1011  {
1013  int x;
1014 
1016  int y;
1017  } ATTR_PACKED game_rel_pointer_event;
1018  //----------------------------------------------------------------------------
1019 
1020  //============================================================================
1022  typedef struct game_abs_pointer_event
1023  {
1025  bool pressed;
1026 
1028  float x;
1029 
1031  float y;
1032  } ATTR_PACKED game_abs_pointer_event;
1033  //----------------------------------------------------------------------------
1034 
1035  //============================================================================
1037  typedef struct game_motor_event
1038  {
1040  float magnitude;
1041  } ATTR_PACKED game_motor_event;
1042  //----------------------------------------------------------------------------
1043 
1044  //============================================================================
1046  typedef struct game_input_event
1047  {
1049  GAME_INPUT_EVENT_SOURCE type;
1050 
1052  const char* controller_id;
1053 
1055  GAME_PORT_TYPE port_type;
1056 
1058  const char* port_address;
1059 
1061  const char* feature_name;
1062 
1063  union
1064  {
1066  struct game_digital_button_event digital_button;
1067 
1069  struct game_analog_button_event analog_button;
1070 
1072  struct game_axis_event axis;
1073 
1075  struct game_analog_stick_event analog_stick;
1076 
1078  struct game_accelerometer_event accelerometer;
1079 
1081  struct game_key_event key;
1082 
1084  struct game_rel_pointer_event rel_pointer;
1085 
1087  struct game_abs_pointer_event abs_pointer;
1088 
1090  struct game_motor_event motor;
1091  };
1092  } ATTR_PACKED game_input_event;
1093  //----------------------------------------------------------------------------
1094 
1096 
1097  //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1103 
1104  //============================================================================
1108  {
1110  double fps;
1111 
1113  double sample_rate;
1114  };
1115  //----------------------------------------------------------------------------
1116 
1118 
1119  //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1120 
1126  typedef struct AddonProps_Game
1127  {
1132 
1136  const char** proxy_dll_paths;
1137 
1141  unsigned int proxy_dll_count;
1142 
1149  const char** resource_directories;
1150 
1155 
1162  const char* profile_directory;
1163 
1168 
1172  const char** extensions;
1173 
1177  unsigned int extension_count;
1178  } AddonProps_Game;
1179 
1180  typedef void* KODI_GAME_STREAM_HANDLE;
1181 
1185  struct AddonInstance_Game;
1186 
1193  {
1194  KODI_HANDLE kodiInstance;
1195 
1196  void (*CloseGame)(KODI_HANDLE kodiInstance);
1197  KODI_GAME_STREAM_HANDLE (*OpenStream)(KODI_HANDLE, const struct game_stream_properties*);
1198  bool (*GetStreamBuffer)(KODI_HANDLE,
1199  KODI_GAME_STREAM_HANDLE,
1200  unsigned int,
1201  unsigned int,
1202  struct game_stream_buffer*);
1203  void (*AddStreamData)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, const struct game_stream_packet*);
1204  void (*ReleaseStreamBuffer)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, struct game_stream_buffer*);
1205  void (*CloseStream)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE);
1206  game_proc_address_t (*HwGetProcAddress)(KODI_HANDLE kodiInstance, const char* symbol);
1207  bool (*InputEvent)(KODI_HANDLE kodiInstance, const struct game_input_event* event);
1209 
1216  {
1217  KODI_HANDLE addonInstance;
1218 
1219  GAME_ERROR(__cdecl* LoadGame)(const struct AddonInstance_Game*, const char*);
1220  GAME_ERROR(__cdecl* LoadGameSpecial)
1221  (const struct AddonInstance_Game*, enum SPECIAL_GAME_TYPE, const char**, size_t);
1222  GAME_ERROR(__cdecl* LoadStandalone)(const struct AddonInstance_Game*);
1223  GAME_ERROR(__cdecl* UnloadGame)(const struct AddonInstance_Game*);
1224  GAME_ERROR(__cdecl* GetGameTiming)
1225  (const struct AddonInstance_Game*, struct game_system_timing*);
1226  GAME_REGION(__cdecl* GetRegion)(const struct AddonInstance_Game*);
1227  bool(__cdecl* RequiresGameLoop)(const struct AddonInstance_Game*);
1228  GAME_ERROR(__cdecl* RunFrame)(const struct AddonInstance_Game*);
1229  GAME_ERROR(__cdecl* Reset)(const struct AddonInstance_Game*);
1230  GAME_ERROR(__cdecl* HwContextReset)(const struct AddonInstance_Game*);
1231  GAME_ERROR(__cdecl* HwContextDestroy)(const struct AddonInstance_Game*);
1232  bool(__cdecl* HasFeature)(const struct AddonInstance_Game*, const char*, const char*);
1233  game_input_topology*(__cdecl* GetTopology)(const struct AddonInstance_Game*);
1234  void(__cdecl* FreeTopology)(const struct AddonInstance_Game*, struct game_input_topology*);
1235  void(__cdecl* SetControllerLayouts)(const struct AddonInstance_Game*,
1236  const struct game_controller_layout*,
1237  unsigned int);
1238  bool(__cdecl* EnableKeyboard)(const struct AddonInstance_Game*, bool, const char*);
1239  bool(__cdecl* EnableMouse)(const struct AddonInstance_Game*, bool, const char*);
1240  bool(__cdecl* ConnectController)(const struct AddonInstance_Game*,
1241  bool,
1242  const char*,
1243  const char*);
1244  bool(__cdecl* InputEvent)(const struct AddonInstance_Game*, const struct game_input_event*);
1245  size_t(__cdecl* SerializeSize)(const struct AddonInstance_Game*);
1246  GAME_ERROR(__cdecl* Serialize)(const struct AddonInstance_Game*, uint8_t*, size_t);
1247  GAME_ERROR(__cdecl* Deserialize)(const struct AddonInstance_Game*, const uint8_t*, size_t);
1248  GAME_ERROR(__cdecl* CheatReset)(const struct AddonInstance_Game*);
1249  GAME_ERROR(__cdecl* GetMemory)
1250  (const struct AddonInstance_Game*, enum GAME_MEMORY, uint8_t**, size_t*);
1251  GAME_ERROR(__cdecl* SetCheat)
1252  (const struct AddonInstance_Game*, unsigned int, bool, const char*);
1253  GAME_ERROR(__cdecl* RCGenerateHashFromFile)
1254  (const AddonInstance_Game*, char**, unsigned int, const char*);
1255  GAME_ERROR(__cdecl* RCGetGameIDUrl)(const AddonInstance_Game*, char**, const char*);
1256  GAME_ERROR(__cdecl* RCGetPatchFileUrl)
1257  (const AddonInstance_Game*, char**, const char*, const char*, unsigned int);
1258  GAME_ERROR(__cdecl* RCPostRichPresenceUrl)
1259  (const AddonInstance_Game*,
1260  char**,
1261  char**,
1262  const char*,
1263  const char*,
1264  unsigned int,
1265  const char*);
1266  GAME_ERROR(__cdecl* RCEnableRichPresence)(const AddonInstance_Game*, const char*);
1267  GAME_ERROR(__cdecl* RCGetRichPresenceEvaluation)
1268  (const AddonInstance_Game*, char**, unsigned int);
1269  GAME_ERROR(__cdecl* RCResetRuntime)(const AddonInstance_Game*);
1270  void(__cdecl* FreeString)(const AddonInstance_Game*, char*);
1272 
1278  typedef struct AddonInstance_Game
1279  {
1280  struct AddonProps_Game* props;
1281  struct AddonToKodiFuncTable_Game* toKodi;
1282  struct KodiToAddonFuncTable_Game* toAddon;
1284 
1285 #ifdef __cplusplus
1286 }
1287 #endif /* __cplusplus */
1288 
1289 #endif /* !C_API_ADDONINSTANCE_GAME_H */
Hardware framebuffer packet
Definition: game.h:390
A motor vibration event.
Definition: game.h:1037
Caps Lock key.
Definition: game.h:812
struct game_stream_video_properties game_stream_video_properties
Game video stream properties
float y
The absolute Y position of the pointer.
Definition: game.h:1031
Channel back right over center.
Definition: game.h:147
unsigned int height
Video width.
Definition: game.h:271
struct game_controller_layout game_controller_layout
"C" Game add-on controller layout.
struct game_abs_pointer_event game_abs_pointer_event
An absolute pointer event, such as a touchscreen or tablet motion.
Num Lock key.
Definition: game.h:809
struct game_stream_packet game_stream_packet
Stream packet and ephemeral metadata
unsigned int version_major
Major version number for core GL context or GLES 3.1+.
Definition: game.h:354
float y
The position of the stick along the Y axis, from -1.0 to 1.0.
Definition: game.h:970
game_stream_hw_framebuffer_buffer hw_framebuffer
The audio stream packet.
Definition: game.h:509
Video ram lets a frontend peek into a game systems video RAM (VRAM)
Definition: game.h:618
Game callbacks.
Definition: game.h:1192
0RGB8888 Format
Definition: game.h:200
A relative pointer event, such as a mouse motion.
Definition: game.h:1010
double fps
FPS of video content.
Definition: game.h:1110
unsigned int max_width
The maximal used width.
Definition: game.h:248
Unknown.
Definition: game.h:454
Key press or release.
Definition: game.h:773
Game properties.
Definition: game.h:1126
GAME_AUDIO_CHANNEL
Audio channel
Definition: game.h:84
Channel back left over center.
Definition: game.h:144
Regular save ram.
Definition: game.h:607
Hardware framebuffer properties
Definition: game.h:324
SIMD CPU AVX.
Definition: game.h:657
Special memory type.
Definition: game.h:627
GAME_VIDEO_ROTATION
Video rotation position
Definition: game.h:215
rotate 270° counterclockwise
Definition: game.h:227
unsigned int nominal_width
The nominal used width.
Definition: game.h:242
Hardware framebuffer.
Definition: game.h:463
Channel low frequency effects / subwoofer.
Definition: game.h:99
Vulkan.
Definition: game.h:317
int x
The relative X position of the pointer.
Definition: game.h:1013
A key event, such as a key press or release.
Definition: game.h:991
Channel top center.
Definition: game.h:132
Channel front center.
Definition: game.h:96
Channel surround/side right.
Definition: game.h:120
const char * feature_name
The name of the feature that generated the event.
Definition: game.h:1061
Port that can provide input.
Definition: game.h:889
OpenGL ES 3.1+. Set major/minor fields.
Definition: game.h:314
float x
The position of the stick along the X axis, from -1.0 to 1.0.
Definition: game.h:967
game_stream_video_properties game_stream_sw_framebuffer_properties
Game software framebuffer stream properties
Definition: game.h:417
struct game_stream_hw_framebuffer_buffer game_stream_hw_framebuffer_buffer
Hardware framebuffer buffer
float magnitude
The magnitude of the button press, from 0.0 to 1.0.
Definition: game.h:946
SPECIAL_GAME_TYPE
**Special game types passed into game_load_game_special().
Definition: game.h:577
Some games have a built-in clock to keep track of time.
Definition: game.h:612
const uint8_t * data
Pointer for video stream data given to Kodi.
Definition: game.h:277
unsigned int port_count
The number of ports.
Definition: game.h:925
game_stream_audio_packet audio
The audio stream packet.
Definition: game.h:532
unsigned int device_count
The number of devices in the accepted devices list.
Definition: game.h:908
float x
The accelerometer X axis, from -1.0 to 1.0.
Definition: game.h:979
SIMD CPU SSSE3.
Definition: game.h:666
The input topology is the possible ways to connect input devices.
Definition: game.h:919
bool supports_vfs
The value of the <supports_vfs> property from addon.xml.
Definition: game.h:1167
struct game_motor_event game_motor_event
A motor vibration event.
GAME_PCM_FORMAT
Stream Format
Definition: game.h:70
struct game_stream_sw_framebuffer_buffer game_stream_sw_framebuffer_buffer
Software framebuffer type
game_stream_video_properties video
The video stream properties.
Definition: game.h:487
const char * port_address
The address of the port that the controller is connected to.
Definition: game.h:1058
GAME_STREAM_TYPE type
The stream type.
Definition: game.h:504
OpenGL ES 3.0.
Definition: game.h:311
Channel top front center.
Definition: game.h:129
bool force_connected
Flag to prevent a port from being disconnected.
Definition: game.h:902
Special memory type.
Definition: game.h:624
int y
The relative Y position of the pointer.
Definition: game.h:1016
unsigned int extension_count
Number of extensions provided.
Definition: game.h:1177
Shift key.
Definition: game.h:794
SIMD CPU VFPU.
Definition: game.h:684
Channel front right over center.
Definition: game.h:111
Relative pointer motion.
Definition: game.h:776
GAME_KEY_MOD
A modifier key pressed to give another key a special meaning.
Definition: game.h:788
Channel back left.
Definition: game.h:102
game_input_port * ports
The list of ports on the virtual game console.
Definition: game.h:922
game_stream_sw_framebuffer_packet sw_framebuffer
The software framebuffer packet.
Definition: game.h:541
SIMD CPU MMX.
Definition: game.h:669
Channel top back right.
Definition: game.h:138
GAME_VIDEO_ROTATION rotation
Width GAME_VIDEO_ROTATION defined rotation angle.
Definition: game.h:274
rotate 180° counterclockwise
Definition: game.h:224
const char * port_address
The address of the port that the device is connected to.
Definition: game.h:876
Accelerometer motion.
Definition: game.h:770
Channel front left over center.
Definition: game.h:108
Game video stream properties
Definition: game.h:236
struct game_input_port game_input_port
Port that can provide input.
"C" Game add-on controller layout.
Definition: game.h:844
Audio stream.
Definition: game.h:457
unsigned int width
Video height.
Definition: game.h:268
Game Type super game boy.
Definition: game.h:589
void(* game_proc_address_t)(void)
Hardware framebuffer process function address
Definition: game.h:400
Channel top back center.
Definition: game.h:141
An accelerometer event.
Definition: game.h:976
struct game_analog_stick_event game_analog_stick_event
An analog stick event, such as a joystick&#39;s motion.
No modifier key.
Definition: game.h:791
Channel surround/side left.
Definition: game.h:117
unsigned int port_count
The number of ports in the available ports list.
Definition: game.h:882
Absolute pointer motion.
Definition: game.h:779
struct game_input_event game_input_event
An input event.
OpenGL ES 2.0.
Definition: game.h:305
An analog stick event, such as a joystick&#39;s motion.
Definition: game.h:964
struct game_analog_button_event game_analog_button_event
An analog button event, such as a trigger press or release.
Meta key.
Definition: game.h:803
Channel top front left.
Definition: game.h:123
Game port controller.
Definition: game.h:833
float y
The accelerometer Y axis, from -1.0 to 1.0.
Definition: game.h:982
struct game_stream_hw_framebuffer_properties game_stream_hw_framebuffer_properties
Hardware framebuffer properties
Stream packet and ephemeral metadata
Definition: game.h:524
const uint8_t * data
Pointer for audio stream data given to Kodi.
Definition: game.h:171
int player_limit
A limit on the number of input-providing devices, or -1 for no limit.
Definition: game.h:928
Special memory type.
Definition: game.h:630
uint32_t unicode
If the keypress generates a printing character.
Definition: game.h:1001
GAME_HW_CONTEXT_TYPE context_type
The API to use.
Definition: game.h:328
size_t size
Size of data array.
Definition: game.h:280
float x
The absolute X position of the pointer.
Definition: game.h:1028
None context.
Definition: game.h:299
GAME_INPUT_EVENT_SOURCE type
The type of input event.
Definition: game.h:1049
Channel top front right.
Definition: game.h:126
const char ** resource_directories
The "system" directories of the frontend.
Definition: game.h:1149
Special memory type.
Definition: game.h:636
An analog button event, such as a trigger press or release.
Definition: game.h:943
GAME_STREAM_TYPE type
The stream type.
Definition: game.h:479
bool stencil
Set if stencil buffers should be attached.
Definition: game.h:343
struct game_input_port * available_ports
The list of ports that the device can be connected to.
Definition: game.h:879
GAME_HW_CONTEXT_TYPE
Hardware framebuffer type
Definition: game.h:296
bool pressed
True if the button is pressed, false if it is released.
Definition: game.h:937
Alt key.
Definition: game.h:800
struct game_digital_button_event game_digital_button_event
A digital button event, such as a button press or release.
Device that can provide input.
Definition: game.h:870
const char * profile_directory
The writable directory of the frontend.
Definition: game.h:1162
unsigned int max_height
The maximal used height.
Definition: game.h:251
const char * port_id
Required for GAME_PORT_CONTROLLER type.
Definition: game.h:895
float z
The accelerometer Z axis, from -1.0 to 1.0.
Definition: game.h:985
Motor vibration.
Definition: game.h:782
S16NE sample format.
Definition: game.h:75
struct game_key_event game_key_event
A key event, such as a key press or release.
Game Type BSX.
Definition: game.h:580
Control key.
Definition: game.h:797
Game region NTSC.
Definition: game.h:565
Game function hooks.
Definition: game.h:1215
const char ** proxy_dll_paths
Paths to proxy DLLs used to load the game client.
Definition: game.h:1136
SIMD CPU AVX2.
Definition: game.h:681
game_stream_hw_framebuffer_properties hw_framebuffer
The hardware framebuffer properties.
Definition: game.h:490
bool cache_context
If this is true, the frontend will go very far to avoid resetting context in scenarios like toggling ...
Definition: game.h:370
OpenGL 2.x. Driver can choose to use latest compatibility context.
Definition: game.h:302
GAME_MEMORY
Game Memory
Definition: game.h:596
GAME_PORT_TYPE port_type
The type of port that the controller is connected to.
Definition: game.h:1055
struct game_stream_video_packet game_stream_video_packet
Video stream packet
Channel top back left.
Definition: game.h:135
0RGB1555 Format
Definition: game.h:206
game_stream_video_packet game_stream_sw_framebuffer_packet
Software framebuffer packet
Definition: game.h:436
struct game_stream_hw_framebuffer_packet game_stream_hw_framebuffer_packet
Hardware framebuffer packet
GAME_PORT_TYPE
Type of port on the virtual game console.
Definition: game.h:821
Software framebuffer.
Definition: game.h:466
bool bottom_left_origin
Use conventional bottom-left origin convention.
Definition: game.h:351
Software framebuffer type
Definition: game.h:423
struct game_rel_pointer_event game_rel_pointer_event
A relative pointer event, such as a mouse motion.
const char * game_client_dll_path
The path of the game client being loaded.
Definition: game.h:1131
Stream buffers for hardware rendering and zero-copy support
Definition: game.h:501
RGB565 Format.
Definition: game.h:203
unsigned int version_minor
Minor version number for core GL context or GLES 3.1+.
Definition: game.h:357
game_input_device * accepted_devices
The list of devices that can be connected to the port.
Definition: game.h:905
SIMD CPU VMX128.
Definition: game.h:654
struct game_input_device game_input_device
Device that can provide input.
Channel back right.
Definition: game.h:105
GAME_PIXEL_FORMAT
Pixel format
Definition: game.h:195
struct game_stream_properties game_stream_properties
Immutable stream metadata
struct game_input_topology game_input_topology
The input topology is the possible ways to connect input devices.
Game Type BSX slotted.
Definition: game.h:583
GAME_SIMD
ID values for SIMD CPU features
Definition: game.h:642
struct game_stream_buffer game_stream_buffer
Stream buffers for hardware rendering and zero-copy support
SIMD CPU SSE2.
Definition: game.h:648
rotate 90° counterclockwise
Definition: game.h:221
GAME_PORT_TYPE type
The type of port.
Definition: game.h:892
SIMD CPU SSE4.
Definition: game.h:675
Hardware framebuffer buffer
Definition: game.h:380
SIMD CPU SSE3.
Definition: game.h:663
Scroll Lock key.
Definition: game.h:815
GAME_REGION
Game region definition
Definition: game.h:559
const char ** extensions
The extensions in the <extensions> property from addon.xml.
Definition: game.h:1172
float magnitude
The magnitude of the vibration, from 0.0 to 1.0.
Definition: game.h:1040
struct game_stream_audio_packet game_stream_audio_packet
Audio stream packet
float position
The position of the axis, from -1.0 to 1.0.
Definition: game.h:955
Channel front left.
Definition: game.h:90
SIMD CPU MMXEXT.
Definition: game.h:672
Passed to game_get_memory_data/size().
Definition: game.h:600
Modern desktop core GL context. Use major/minor fields to set GL version.
Definition: game.h:308
unsigned int proxy_dll_count
Number of proxy DLL paths provided.
Definition: game.h:1141
game_stream_hw_framebuffer_packet hw_framebuffer
The hardware framebuffer packet.
Definition: game.h:538
game_stream_sw_framebuffer_properties sw_framebuffer
The software framebuffer properties.
Definition: game.h:493
GAME_PIXEL_FORMAT format
The stream&#39;s pixel format.
Definition: game.h:239
SIMD CPU SSE42.
Definition: game.h:678
Game port unknown.
Definition: game.h:824
GAME_STREAM_TYPE type
The stream type.
Definition: game.h:527
An axis event, such as a joystick or accelerometer.
Definition: game.h:952
A digital button event, such as a button press or release.
Definition: game.h:934
Game instance.
Definition: game.h:1278
struct game_stream_audio_properties game_stream_audio_properties
Game audio stream properties
Axis motion.
Definition: game.h:764
Channel back center.
Definition: game.h:114
game_stream_video_packet video
The video stream packet.
Definition: game.h:535
An input event.
Definition: game.h:1046
Game Type sufami turbo.
Definition: game.h:586
System ram lets a frontend peek into a game systems main RAM.
Definition: game.h:615
Channel front right.
Definition: game.h:93
Video stream.
Definition: game.h:460
bool depth
Set if render buffers should have depth component attached.
Definition: game.h:334
struct game_axis_event game_axis_event
An axis event, such as a joystick or accelerometer.
Game port mouse.
Definition: game.h:830
Windows key.
Definition: game.h:806
game_stream_audio_properties audio
The audio stream properties.
Definition: game.h:484
bool pressed
True if the key is pressed, false if it is released.
Definition: game.h:994
float aspect_ratio
On video stream used aspect ration.
Definition: game.h:256
Audio stream packet
Definition: game.h:168
Immutable stream metadata
Definition: game.h:476
Game port Keyboard.
Definition: game.h:827
unsigned int resource_directory_count
Number of resource directories provided.
Definition: game.h:1154
Special memory type.
Definition: game.h:633
const char * controller_id
ID used in the Kodi controller API, e.g. game.controller.default
Definition: game.h:873
SIMD CPU SSE.
Definition: game.h:645
Digital button press or release.
Definition: game.h:758
Analog stick motion.
Definition: game.h:767
double sample_rate
Sampling rate of audio.
Definition: game.h:1113
game_stream_sw_framebuffer_buffer sw_framebuffer
The video stream packet.
Definition: game.h:512
Channel list terminator.
Definition: game.h:87
SIMD CPU VMX.
Definition: game.h:651
Game region unknown.
Definition: game.h:562
Game region PAL.
Definition: game.h:568
bool debug_context
Creates a debug context.
Definition: game.h:373
Game system timing.
Definition: game.h:1107
GAME_INPUT_EVENT_SOURCE
Type of input event.
Definition: game.h:755
Game audio stream properties
Definition: game.h:156
GAME_KEY_MOD modifiers
Modifier keys pressed with the event key.
Definition: game.h:1004
SIMD CPU NEON.
Definition: game.h:660
GAME_STREAM_TYPE
Game stream types
Definition: game.h:451
Video stream packet
Definition: game.h:265
An absolute pointer event, such as a touchscreen or tablet motion.
Definition: game.h:1022
bool pressed
True if the pointer is pressed, false if it is released.
Definition: game.h:1025
Analog button motion.
Definition: game.h:761
struct game_accelerometer_event game_accelerometer_event
An accelerometer event.
0° and Without rotation
Definition: game.h:218
unsigned int nominal_height
The nominal used height.
Definition: game.h:245
const char * controller_id
The ID of the controller that generated the event.
Definition: game.h:1052
size_t size
Size of data array.
Definition: game.h:174
Special memory type.
Definition: game.h:621