Kodi Development 19.0
for Binary and Script based Add-Ons
game.h
1/*
2 * Copyright (C) 2014-2020 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//==============================================================================
19#define DEFAULT_PORT_ID "1"
20//------------------------------------------------------------------------------
21
22#ifdef __cplusplus
23extern "C"
24{
25#endif /* __cplusplus */
26
27 //============================================================================
33 typedef enum GAME_ERROR
34 {
37
40
43
46
49
52
55
58 } GAME_ERROR;
59 //----------------------------------------------------------------------------
60
61 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
70
71 //============================================================================
76 typedef enum GAME_PCM_FORMAT
77 {
78 GAME_PCM_FORMAT_UNKNOWN,
79
83 //----------------------------------------------------------------------------
84
85 //============================================================================
90 typedef enum GAME_AUDIO_CHANNEL
91 {
94
97
100
103
106
109
112
115
118
121
124
127
130
133
136
139
142
145
148
151
155 //----------------------------------------------------------------------------
156
157 //============================================================================
163 {
164 GAME_PCM_FORMAT format;
165 const GAME_AUDIO_CHANNEL* channel_map;
166 } ATTRIBUTE_PACKED game_stream_audio_properties;
167 //----------------------------------------------------------------------------
168
169 //============================================================================
175 {
177 const uint8_t* data;
178
180 size_t size;
181 } ATTRIBUTE_PACKED game_stream_audio_packet;
182 //----------------------------------------------------------------------------
183
185
186 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
195
196 //============================================================================
201 typedef enum GAME_PIXEL_FORMAT
202 {
203 GAME_PIXEL_FORMAT_UNKNOWN,
204
207
210
214 //----------------------------------------------------------------------------
215
216 //============================================================================
222 {
225
228
231
235 //----------------------------------------------------------------------------
236
237 //============================================================================
243 {
246
248 unsigned int nominal_width;
249
251 unsigned int nominal_height;
252
254 unsigned int max_width;
255
257 unsigned int max_height;
258
263 } ATTRIBUTE_PACKED game_stream_video_properties;
264 //----------------------------------------------------------------------------
265
266 //============================================================================
272 {
274 unsigned int width;
275
277 unsigned int height;
278
281
283 const uint8_t* data;
284
286 size_t size;
287 } ATTRIBUTE_PACKED game_stream_video_packet;
288 //----------------------------------------------------------------------------
289
291
292 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
298
299 //============================================================================
303 {
306
309
312
315
318
321
325 //----------------------------------------------------------------------------
326
327 //============================================================================
331 {
335
340 bool depth;
341
350
358
360 unsigned int version_major;
361
363 unsigned int version_minor;
364
377
380 } ATTRIBUTE_PACKED game_stream_hw_framebuffer_properties;
381 //----------------------------------------------------------------------------
382
383 //============================================================================
387 {
389 uintptr_t framebuffer;
390 } ATTRIBUTE_PACKED game_stream_hw_framebuffer_buffer;
391 //----------------------------------------------------------------------------
392
393 //============================================================================
397 {
399 uintptr_t framebuffer;
400 } ATTRIBUTE_PACKED game_stream_hw_framebuffer_packet;
401 //----------------------------------------------------------------------------
402
403 //============================================================================
406 typedef void (*game_proc_address_t)(void);
407 //----------------------------------------------------------------------------
408
410
411 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
417
418 //============================================================================
424 //----------------------------------------------------------------------------
425
426 //============================================================================
430 {
431 GAME_PIXEL_FORMAT format;
432 uint8_t* data;
433 size_t size;
434 } ATTRIBUTE_PACKED game_stream_sw_framebuffer_buffer;
435 //----------------------------------------------------------------------------
436
437 //============================================================================
443 //----------------------------------------------------------------------------
444
446
447 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
453
454 //============================================================================
457 typedef enum GAME_STREAM_TYPE
458 {
461
464
467
470
474 //----------------------------------------------------------------------------
475
476 //============================================================================
483 {
485 GAME_STREAM_TYPE type;
486 union
487 {
490
493
496
499 };
500 } ATTRIBUTE_PACKED game_stream_properties;
501 //----------------------------------------------------------------------------
502
503 //============================================================================
506 typedef struct game_stream_buffer
507 {
509 GAME_STREAM_TYPE type;
510 union
511 {
514
517 };
518 } ATTRIBUTE_PACKED game_stream_buffer;
519 //----------------------------------------------------------------------------
520
521 //============================================================================
528 typedef struct game_stream_packet
529 {
531 GAME_STREAM_TYPE type;
532 union
533 {
536
539
542
545 };
546 } ATTRIBUTE_PACKED game_stream_packet;
547 //----------------------------------------------------------------------------
548
550
551 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
557
558 //============================================================================
562 typedef enum GAME_REGION
563 {
566
569
572 } GAME_REGION;
573 //----------------------------------------------------------------------------
574
575 //============================================================================
580 typedef enum SPECIAL_GAME_TYPE
581 {
584
587
590
594 //----------------------------------------------------------------------------
595
596 //============================================================================
599 typedef enum GAME_MEMORY
600 {
604
611
616
619
622
625
628
631
634
637
640 } GAME_MEMORY;
641 //----------------------------------------------------------------------------
642
643 //============================================================================
645 typedef enum GAME_SIMD
646 {
648 GAME_SIMD_SSE = (1 << 0),
649
651 GAME_SIMD_SSE2 = (1 << 1),
652
654 GAME_SIMD_VMX = (1 << 2),
655
658
660 GAME_SIMD_AVX = (1 << 4),
661
663 GAME_SIMD_NEON = (1 << 5),
664
666 GAME_SIMD_SSE3 = (1 << 6),
667
669 GAME_SIMD_SSSE3 = (1 << 7),
670
672 GAME_SIMD_MMX = (1 << 8),
673
676
678 GAME_SIMD_SSE4 = (1 << 10),
679
681 GAME_SIMD_SSE42 = (1 << 11),
682
684 GAME_SIMD_AVX2 = (1 << 12),
685
687 GAME_SIMD_VFPU = (1 << 13),
688 } GAME_SIMD;
689 //----------------------------------------------------------------------------
690
692
693 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
699
700 //============================================================================
702 typedef enum GAME_INPUT_EVENT_SOURCE
703 {
705 GAME_INPUT_EVENT_DIGITAL_BUTTON,
706
708 GAME_INPUT_EVENT_ANALOG_BUTTON,
709
711 GAME_INPUT_EVENT_AXIS,
712
714 GAME_INPUT_EVENT_ANALOG_STICK,
715
717 GAME_INPUT_EVENT_ACCELEROMETER,
718
720 GAME_INPUT_EVENT_KEY,
721
723 GAME_INPUT_EVENT_RELATIVE_POINTER,
724
726 GAME_INPUT_EVENT_ABSOLUTE_POINTER,
727
729 GAME_INPUT_EVENT_MOTOR,
730 } GAME_INPUT_EVENT_SOURCE;
731 //----------------------------------------------------------------------------
732
733 //============================================================================
735 typedef enum GAME_KEY_MOD
736 {
738 GAME_KEY_MOD_NONE = 0x0000,
739
741 GAME_KEY_MOD_SHIFT = 0x0001,
742
744 GAME_KEY_MOD_CTRL = 0x0002,
745
747 GAME_KEY_MOD_ALT = 0x0004,
748
750 GAME_KEY_MOD_META = 0x0008,
751
753 GAME_KEY_MOD_SUPER = 0x0010,
754
756 GAME_KEY_MOD_NUMLOCK = 0x0100,
757
759 GAME_KEY_MOD_CAPSLOCK = 0x0200,
760
762 GAME_KEY_MOD_SCROLLOCK = 0x0400,
763 } GAME_KEY_MOD;
764 //----------------------------------------------------------------------------
765
766 //============================================================================
768 typedef enum GAME_PORT_TYPE
769 {
772
775
778
782 //----------------------------------------------------------------------------
783
792 typedef struct game_controller_layout
793 {
794 char* controller_id;
795 bool provides_input; // False for multitaps
796 char** digital_buttons;
797 unsigned int digital_button_count;
798 char** analog_buttons;
799 unsigned int analog_button_count;
800 char** analog_sticks;
801 unsigned int analog_stick_count;
802 char** accelerometers;
803 unsigned int accelerometer_count;
804 char** keys;
805 unsigned int key_count;
806 char** rel_pointers;
807 unsigned int rel_pointer_count;
808 char** abs_pointers;
809 unsigned int abs_pointer_count;
810 char** motors;
811 unsigned int motor_count;
812 } ATTRIBUTE_PACKED game_controller_layout;
815 struct game_input_port;
816
817 //============================================================================
819 typedef struct game_input_device
820 {
822 const char* controller_id;
823
825 const char* port_address;
826
828 struct game_input_port* available_ports;
829
831 unsigned int port_count;
832 } ATTRIBUTE_PACKED game_input_device;
833 //----------------------------------------------------------------------------
834
835 //============================================================================
842 typedef struct game_input_port
843 {
845 GAME_PORT_TYPE type;
846
848 const char* port_id;
849
851 game_input_device* accepted_devices;
852
854 unsigned int device_count;
855 } ATTRIBUTE_PACKED game_input_port;
856 //----------------------------------------------------------------------------
857
858 //============================================================================
865 typedef struct game_input_topology
866 {
869
871 unsigned int port_count;
872
875 } ATTRIBUTE_PACKED game_input_topology;
876 //----------------------------------------------------------------------------
877
878 //============================================================================
881 {
883 bool pressed;
884 } ATTRIBUTE_PACKED game_digital_button_event;
885 //----------------------------------------------------------------------------
886
887 //============================================================================
890 {
892 float magnitude;
893 } ATTRIBUTE_PACKED game_analog_button_event;
894 //----------------------------------------------------------------------------
895
896 //============================================================================
898 typedef struct game_axis_event
899 {
901 float position;
902 } ATTRIBUTE_PACKED game_axis_event;
903 //----------------------------------------------------------------------------
904
905 //============================================================================
908 {
910 float x;
911
913 float y;
914 } ATTRIBUTE_PACKED game_analog_stick_event;
915 //----------------------------------------------------------------------------
916
917 //============================================================================
920 {
922 float x;
923
925 float y;
926
928 float z;
929 } ATTRIBUTE_PACKED game_accelerometer_event;
930 //----------------------------------------------------------------------------
931
932 //============================================================================
934 typedef struct game_key_event
935 {
937 bool pressed;
938
944 uint32_t unicode;
945
947 GAME_KEY_MOD modifiers;
948 } ATTRIBUTE_PACKED game_key_event;
949 //----------------------------------------------------------------------------
950
951 //============================================================================
954 {
956 int x;
957
959 int y;
960 } ATTRIBUTE_PACKED game_rel_pointer_event;
961 //----------------------------------------------------------------------------
962
963 //============================================================================
966 {
968 bool pressed;
969
971 float x;
972
974 float y;
975 } ATTRIBUTE_PACKED game_abs_pointer_event;
976 //----------------------------------------------------------------------------
977
978 //============================================================================
980 typedef struct game_motor_event
981 {
983 float magnitude;
984 } ATTRIBUTE_PACKED game_motor_event;
985 //----------------------------------------------------------------------------
986
987 //============================================================================
989 typedef struct game_input_event
990 {
992 GAME_INPUT_EVENT_SOURCE type;
993
995 const char* controller_id;
996
998 GAME_PORT_TYPE port_type;
999
1001 const char* port_address;
1002
1004 const char* feature_name;
1005 union
1006 {
1008 struct game_digital_button_event digital_button;
1009
1011 struct game_analog_button_event analog_button;
1012
1014 struct game_axis_event axis;
1015
1017 struct game_analog_stick_event analog_stick;
1018
1020 struct game_accelerometer_event accelerometer;
1021
1023 struct game_key_event key;
1024
1026 struct game_rel_pointer_event rel_pointer;
1027
1029 struct game_abs_pointer_event abs_pointer;
1030
1032 struct game_motor_event motor;
1033 };
1034 } ATTRIBUTE_PACKED game_input_event;
1035 //----------------------------------------------------------------------------
1036
1038
1039 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1045
1046 //============================================================================
1050 {
1052 double fps;
1053
1056 };
1057 //----------------------------------------------------------------------------
1058
1060
1061
1062 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1063
1069 typedef struct AddonProps_Game
1070 {
1075
1079 const char** proxy_dll_paths;
1080
1084 unsigned int proxy_dll_count;
1085
1091
1096
1103
1108
1112 const char** extensions;
1113
1117 unsigned int extension_count;
1119
1120 typedef void* KODI_GAME_STREAM_HANDLE;
1121
1124 struct AddonInstance_Game;
1125
1132 {
1133 KODI_HANDLE kodiInstance;
1134
1135 void (*CloseGame)(KODI_HANDLE kodiInstance);
1136 KODI_GAME_STREAM_HANDLE (*OpenStream)(KODI_HANDLE, const struct game_stream_properties*);
1137 bool (*GetStreamBuffer)(KODI_HANDLE,
1138 KODI_GAME_STREAM_HANDLE,
1139 unsigned int,
1140 unsigned int,
1141 struct game_stream_buffer*);
1142 void (*AddStreamData)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, const struct game_stream_packet*);
1143 void (*ReleaseStreamBuffer)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, struct game_stream_buffer*);
1144 void (*CloseStream)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE);
1145 game_proc_address_t (*HwGetProcAddress)(KODI_HANDLE kodiInstance, const char* symbol);
1146 bool (*InputEvent)(KODI_HANDLE kodiInstance, const struct game_input_event* event);
1148
1155 {
1156 KODI_HANDLE addonInstance;
1157
1158 GAME_ERROR(__cdecl* LoadGame)(const struct AddonInstance_Game*, const char*);
1159 GAME_ERROR(__cdecl* LoadGameSpecial)
1160 (const struct AddonInstance_Game*, enum SPECIAL_GAME_TYPE, const char**, size_t);
1161 GAME_ERROR(__cdecl* LoadStandalone)(const struct AddonInstance_Game*);
1162 GAME_ERROR(__cdecl* UnloadGame)(const struct AddonInstance_Game*);
1163 GAME_ERROR(__cdecl* GetGameTiming)
1164 (const struct AddonInstance_Game*, struct game_system_timing*);
1165 GAME_REGION(__cdecl* GetRegion)(const struct AddonInstance_Game*);
1166 bool(__cdecl* RequiresGameLoop)(const struct AddonInstance_Game*);
1167 GAME_ERROR(__cdecl* RunFrame)(const struct AddonInstance_Game*);
1168 GAME_ERROR(__cdecl* Reset)(const struct AddonInstance_Game*);
1169 GAME_ERROR(__cdecl* HwContextReset)(const struct AddonInstance_Game*);
1170 GAME_ERROR(__cdecl* HwContextDestroy)(const struct AddonInstance_Game*);
1171 bool(__cdecl* HasFeature)(const struct AddonInstance_Game*, const char*, const char*);
1172 game_input_topology*(__cdecl* GetTopology)(const struct AddonInstance_Game*);
1173 void(__cdecl* FreeTopology)(const struct AddonInstance_Game*, struct game_input_topology*);
1174 void(__cdecl* SetControllerLayouts)(const struct AddonInstance_Game*,
1175 const struct game_controller_layout*,
1176 unsigned int);
1177 bool(__cdecl* EnableKeyboard)(const struct AddonInstance_Game*, bool, const char*);
1178 bool(__cdecl* EnableMouse)(const struct AddonInstance_Game*, bool, const char*);
1179 bool(__cdecl* ConnectController)(const struct AddonInstance_Game*,
1180 bool,
1181 const char*,
1182 const char*);
1183 bool(__cdecl* InputEvent)(const struct AddonInstance_Game*, const struct game_input_event*);
1184 size_t(__cdecl* SerializeSize)(const struct AddonInstance_Game*);
1185 GAME_ERROR(__cdecl* Serialize)(const struct AddonInstance_Game*, uint8_t*, size_t);
1186 GAME_ERROR(__cdecl* Deserialize)(const struct AddonInstance_Game*, const uint8_t*, size_t);
1187 GAME_ERROR(__cdecl* CheatReset)(const struct AddonInstance_Game*);
1188 GAME_ERROR(__cdecl* GetMemory)
1189 (const struct AddonInstance_Game*, enum GAME_MEMORY, uint8_t**, size_t*);
1190 GAME_ERROR(__cdecl* SetCheat)
1191 (const struct AddonInstance_Game*, unsigned int, bool, const char*);
1193
1199 typedef struct AddonInstance_Game
1200 {
1201 struct AddonProps_Game* props;
1202 struct AddonToKodiFuncTable_Game* toKodi;
1203 struct KodiToAddonFuncTable_Game* toAddon;
1205
1206#ifdef __cplusplus
1207}
1208#endif /* __cplusplus */
1209
1210#endif /* !C_API_ADDONINSTANCE_GAME_H */
const uint8_t * data
Pointer for audio stream data given to Kodi.
Definition: game.h:177
size_t size
Size of data array.
Definition: game.h:180
GAME_AUDIO_CHANNEL
Audio channel
Definition: game.h:91
GAME_PCM_FORMAT
Stream Format
Definition: game.h:77
@ GAME_CH_TFC
Channel top front center.
Definition: game.h:135
@ GAME_CH_FL
Channel front left.
Definition: game.h:96
@ GAME_CH_BL
Channel back left.
Definition: game.h:108
@ GAME_CH_TBR
Channel top back right.
Definition: game.h:144
@ GAME_CH_FC
Channel front center.
Definition: game.h:102
@ GAME_CH_BLOC
Channel bacl left over center.
Definition: game.h:150
@ GAME_CH_TFL
Channel top front left.
Definition: game.h:129
@ GAME_CH_NULL
Channel list terminator.
Definition: game.h:93
@ GAME_CH_TBC
Channel top back center.
Definition: game.h:147
@ GAME_CH_SR
Channel surround/side right.
Definition: game.h:126
@ GAME_CH_TFR
Channel top front right.
Definition: game.h:132
@ GAME_CH_FR
Channel front right.
Definition: game.h:99
@ GAME_CH_BC
Channel back center.
Definition: game.h:120
@ GAME_CH_SL
Channel surround/side left.
Definition: game.h:123
@ GAME_CH_LFE
Channel Low Frequency Effects / Subwoofer.
Definition: game.h:105
@ GAME_CH_BROC
Channel back right over center.
Definition: game.h:153
@ GAME_CH_TC
Channel top center.
Definition: game.h:138
@ GAME_CH_FLOC
Channel front left over center.
Definition: game.h:114
@ GAME_CH_FROC
Channel front right over center.
Definition: game.h:117
@ GAME_CH_TBL
Channel top back left.
Definition: game.h:141
@ GAME_CH_BR
Channel back right.
Definition: game.h:111
@ GAME_PCM_FORMAT_S16NE
S16NE sample format.
Definition: game.h:81
Audio stream packet
Definition: game.h:175
Game audio stream properties
Definition: game.h:163
double sample_rate
Sampling rate of audio.
Definition: game.h:1055
double fps
FPS of video content.
Definition: game.h:1052
Game system timing.
Definition: game.h:1050
GAME_SIMD
ID values for SIMD CPU features
Definition: game.h:646
GAME_REGION
Game reguin definition
Definition: game.h:563
SPECIAL_GAME_TYPE
Special game types passed into game_load_game_special().
Definition: game.h:581
GAME_MEMORY
Game Memory
Definition: game.h:600
@ GAME_SIMD_VFPU
SIMD CPU VFPU.
Definition: game.h:687
@ GAME_SIMD_VMX128
SIMD CPU VMX128.
Definition: game.h:657
@ GAME_SIMD_SSE
SIMD CPU SSE.
Definition: game.h:648
@ GAME_SIMD_SSE4
SIMD CPU SSE4.
Definition: game.h:678
@ GAME_SIMD_NEON
SIMD CPU NEON.
Definition: game.h:663
@ GAME_SIMD_AVX2
SIMD CPU AVX2.
Definition: game.h:684
@ GAME_SIMD_SSE42
SIMD CPU SSE42.
Definition: game.h:681
@ GAME_SIMD_SSSE3
SIMD CPU SSSE3.
Definition: game.h:669
@ GAME_SIMD_SSE2
SIMD CPU SSE2.
Definition: game.h:651
@ GAME_SIMD_SSE3
SIMD CPU SSE3.
Definition: game.h:666
@ GAME_SIMD_AVX
SIMD CPU AVX.
Definition: game.h:660
@ GAME_SIMD_MMXEXT
SIMD CPU MMXEXT.
Definition: game.h:675
@ GAME_SIMD_MMX
SIMD CPU MMX.
Definition: game.h:672
@ GAME_SIMD_VMX
SIMD CPU VMX.
Definition: game.h:654
@ GAME_REGION_NTSC
Game region NTSC.
Definition: game.h:568
@ GAME_REGION_PAL
Game region PAL.
Definition: game.h:571
@ GAME_REGION_UNKNOWN
Game region unknown.
Definition: game.h:565
@ SPECIAL_GAME_TYPE_SUPER_GAME_BOY
Game Type super game boy.
Definition: game.h:592
@ SPECIAL_GAME_TYPE_BSX
Game Type BSX.
Definition: game.h:583
@ SPECIAL_GAME_TYPE_BSX_SLOTTED
Game Type BSX slotted.
Definition: game.h:586
@ SPECIAL_GAME_TYPE_SUFAMI_TURBO
Game Type sufami turbo.
Definition: game.h:589
@ GAME_MEMORY_SNES_SUFAMI_TURBO_A_RAM
Special memory type.
Definition: game.h:630
@ GAME_MEMORY_VIDEO_RAM
Video ram lets a frontend peek into a game systems video RAM (VRAM)
Definition: game.h:621
@ GAME_MEMORY_SNES_SUFAMI_TURBO_B_RAM
Special memory type.
Definition: game.h:633
@ GAME_MEMORY_SNES_GAME_BOY_RTC
Special memory type.
Definition: game.h:639
@ GAME_MEMORY_SNES_BSX_PRAM
Special memory type.
Definition: game.h:627
@ 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:603
@ GAME_MEMORY_SAVE_RAM
Regular save ram.
Definition: game.h:610
@ GAME_MEMORY_SYSTEM_RAM
System ram lets a frontend peek into a game systems main RAM.
Definition: game.h:618
@ GAME_MEMORY_SNES_BSX_RAM
Special memory type.
Definition: game.h:624
@ GAME_MEMORY_RTC
Some games have a built-in clock to keep track of time.
Definition: game.h:615
@ GAME_MEMORY_SNES_GAME_BOY_RAM
Special memory type.
Definition: game.h:636
bool cache_context
If this is true, the frontend will go very far to avoid resetting context in scenarios like toggling ...
Definition: game.h:376
unsigned int version_minor
Minor version number for core GL context or GLES 3.1+.
Definition: game.h:363
bool depth
Set if render buffers should have depth component attached.
Definition: game.h:340
unsigned int version_major
Major version number for core GL context or GLES 3.1+.
Definition: game.h:360
bool bottom_left_origin
Use conventional bottom-left origin convention.
Definition: game.h:357
GAME_HW_CONTEXT_TYPE context_type
The API to use.
Definition: game.h:334
bool debug_context
Creates a debug context.
Definition: game.h:379
bool stencil
Set if stencil buffers should be attached.
Definition: game.h:349
void(* game_proc_address_t)(void)
Hardware framebuffer process function address
Definition: game.h:406
GAME_HW_CONTEXT_TYPE
Hardware framebuffer type
Definition: game.h:303
@ GAME_HW_CONTEXT_OPENGLES2
OpenGL ES 2.0.
Definition: game.h:311
@ GAME_HW_CONTEXT_OPENGL_CORE
Modern desktop core GL context. Use major/minor fields to set GL version.
Definition: game.h:314
@ GAME_HW_CONTEXT_VULKAN
Vulkan.
Definition: game.h:323
@ GAME_HW_CONTEXT_OPENGLES_VERSION
OpenGL ES 3.1+. Set major/minor fields.
Definition: game.h:320
@ GAME_HW_CONTEXT_OPENGLES3
OpenGL ES 3.0.
Definition: game.h:317
@ GAME_HW_CONTEXT_NONE
None context.
Definition: game.h:305
@ GAME_HW_CONTEXT_OPENGL
OpenGL 2.x. Driver can choose to use latest compatibility context.
Definition: game.h:308
Hardware framebuffer buffer
Definition: game.h:387
Hardware framebuffer packet
Definition: game.h:397
Hardware framebuffer properties
Definition: game.h:331
unsigned int port_count
The number of ports.
Definition: game.h:871
game_input_port * ports
The list of ports on the virtual game console.
Definition: game.h:868
const char * controller_id
ID used in the Kodi controller API.
Definition: game.h:822
uint32_t unicode
If the keypress generates a printing character.
Definition: game.h:944
int player_limit
A limit on the number of input-providing devices, or -1 for no limit.
Definition: game.h:874
const char * port_id
Required for GAME_PORT_CONTROLLER type.
Definition: game.h:848
GAME_PORT_TYPE
Type of port on the virtual game console.
Definition: game.h:769
@ GAME_PORT_MOUSE
Game port mouse.
Definition: game.h:777
@ GAME_PORT_CONTROLLER
Game port controller.
Definition: game.h:780
@ GAME_PORT_KEYBOARD
Game port Keyboard.
Definition: game.h:774
@ GAME_PORT_UNKNOWN
Game port unknown.
Definition: game.h:771
Definition: game.h:966
Definition: game.h:920
Definition: game.h:890
Definition: game.h:908
Definition: game.h:899
Definition: game.h:881
Device that can provide input.
Definition: game.h:820
Definition: game.h:990
Port that can provide input.
Definition: game.h:843
The input topology is the possible ways to connect input devices.
Definition: game.h:866
Definition: game.h:935
Definition: game.h:981
Definition: game.h:954
game_stream_video_packet game_stream_sw_framebuffer_packet
Video stream packet
Definition: game.h:442
game_stream_video_properties game_stream_sw_framebuffer_properties
Game video stream properties
Definition: game.h:423
Hardware framebuffer type
Definition: game.h:430
GAME_STREAM_TYPE
Game stream types
Definition: game.h:458
@ GAME_STREAM_VIDEO
Video stream.
Definition: game.h:466
@ GAME_STREAM_AUDIO
Audio stream.
Definition: game.h:463
@ GAME_STREAM_HW_FRAMEBUFFER
Hardware framebuffer.
Definition: game.h:469
@ GAME_STREAM_UNKNOWN
Unknown.
Definition: game.h:460
@ GAME_STREAM_SW_FRAMEBUFFER
Software framebuffer.
Definition: game.h:472
Stream buffers for hardware rendering and zero-copy support
Definition: game.h:507
Stream packet and ephemeral metadata
Definition: game.h:529
Immutable stream metadata
Definition: game.h:483
float aspect_ratio
On video stream used aspect ration.
Definition: game.h:262
const uint8_t * data
Pointer for video stream data given to Kodi.
Definition: game.h:283
size_t size
Size of data array.
Definition: game.h:286
unsigned int nominal_width
The nominal used width.
Definition: game.h:248
unsigned int max_height
The maximal used height.
Definition: game.h:257
GAME_VIDEO_ROTATION rotation
Width GAME_VIDEO_ROTATION defined rotation angle.
Definition: game.h:280
unsigned int height
Video width.
Definition: game.h:277
unsigned int max_width
The maximal used width.
Definition: game.h:254
unsigned int width
Video height.
Definition: game.h:274
GAME_PIXEL_FORMAT format
The to used pixel format.
Definition: game.h:245
unsigned int nominal_height
The nominal used height.
Definition: game.h:251
GAME_PIXEL_FORMAT
Pixel format
Definition: game.h:202
GAME_VIDEO_ROTATION
Video rotation position
Definition: game.h:222
@ GAME_PIXEL_FORMAT_RGB565
RGB565 Format.
Definition: game.h:209
@ GAME_PIXEL_FORMAT_0RGB1555
0RGB1555 Format
Definition: game.h:212
@ GAME_PIXEL_FORMAT_0RGB8888
0RGB8888 Format
Definition: game.h:206
@ GAME_VIDEO_ROTATION_180_CCW
rotate 180° counterclockwise
Definition: game.h:230
@ GAME_VIDEO_ROTATION_0
0° and Without rotation
Definition: game.h:224
@ GAME_VIDEO_ROTATION_90_CCW
rotate 90° counterclockwise
Definition: game.h:227
@ GAME_VIDEO_ROTATION_270_CCW
rotate 270° counterclockwise
Definition: game.h:233
Video stream packet
Definition: game.h:272
Game video stream properties
Definition: game.h:243
GAME_ERROR
Game add-on error codes
Definition: game.h:34
@ GAME_ERROR_FAILED
the command failed
Definition: game.h:51
@ GAME_ERROR_REJECTED
the command was rejected by the game client
Definition: game.h:45
@ GAME_ERROR_INVALID_PARAMETERS
the parameters of the method that was called are invalid for this operation
Definition: game.h:48
@ GAME_ERROR_UNKNOWN
an unknown error occurred
Definition: game.h:39
@ GAME_ERROR_NO_ERROR
no error occurred
Definition: game.h:36
@ GAME_ERROR_RESTRICTED
game requires restricted resources
Definition: game.h:57
@ GAME_ERROR_NOT_LOADED
no game is loaded
Definition: game.h:54
@ GAME_ERROR_NOT_IMPLEMENTED
the method that the frontend called is not implemented
Definition: game.h:42
std::string ATTRIBUTE_HIDDEN GetRegion(const std::string &id)
Returns your regions setting as a string for the specified id.
Definition: General.h:478
Game instance.
Definition: game.h:1200
Game properties.
Definition: game.h:1070
const char ** resource_directories
Definition: game.h:1090
unsigned int proxy_dll_count
Definition: game.h:1084
const char * profile_directory
Definition: game.h:1102
const char * game_client_dll_path
Definition: game.h:1074
unsigned int extension_count
Definition: game.h:1117
bool supports_vfs
Definition: game.h:1107
const char ** proxy_dll_paths
Definition: game.h:1079
const char ** extensions
Definition: game.h:1112
unsigned int resource_directory_count
Definition: game.h:1095
Game callbacks.
Definition: game.h:1132
Game function hooks.
Definition: game.h:1155