9#ifndef C_API_ADDONINSTANCE_GAME_H
10#define C_API_ADDONINSTANCE_GAME_H
12#include "../addon_base.h"
72 GAME_PCM_FORMAT_UNKNOWN,
197 GAME_PIXEL_FORMAT_UNKNOWN,
400 uintptr_t framebuffer;
410 uintptr_t framebuffer;
737#define ROOT_PORT_ADDRESS "/"
742#define DEFAULT_PORT_ID "1"
747#define KEYBOARD_PORT_ID "keyboard"
752#define MOUSE_PORT_ID "mouse"
757#define DEFAULT_PORT_ADDRESS "/1"
762#define KEYBOARD_PORT_ADDRESS "/keyboard"
767#define MOUSE_PORT_ADDRESS "/mouse"
865 char** digital_buttons;
866 unsigned int digital_button_count;
867 char** analog_buttons;
868 unsigned int analog_button_count;
869 char** analog_sticks;
870 unsigned int analog_stick_count;
871 char** accelerometers;
872 unsigned int accelerometer_count;
874 unsigned int key_count;
876 unsigned int rel_pointer_count;
878 unsigned int abs_pointer_count;
880 unsigned int motor_count;
1197 typedef void* KODI_GAME_STREAM_HANDLE;
1211 KODI_HANDLE kodiInstance;
1214 void (*CloseGame)(KODI_HANDLE kodiInstance);
1216 bool (*GetStreamBuffer)(KODI_HANDLE,
1217 KODI_GAME_STREAM_HANDLE,
1221 void (*AddStreamData)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE,
const struct game_stream_packet*);
1222 void (*ReleaseStreamBuffer)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE,
struct game_stream_buffer*);
1223 void (*CloseStream)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE);
1225 bool (*InputEvent)(KODI_HANDLE kodiInstance,
const struct game_input_event* event);
1235 KODI_HANDLE addonInstance;
1250 bool(__cdecl* HasFeature)(
const struct AddonInstance_Game*,
const char*,
const char*);
1285 GAME_ERROR(__cdecl* RCGetRichPresenceEvaluation)
const uint8_t * data
Pointer for audio stream data given to Kodi.
Definition game.h:171
size_t size
Size of 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:1130
double fps
FPS of video content.
Definition game.h:1127
Game system timing.
Definition game.h:1125
GAME_SIMD
ID values for SIMD CPU features
Definition game.h:660
GAME_REGION
Game region definition
Definition game.h:577
SPECIAL_GAME_TYPE
Special game types passed into game_load_game_special().
Definition game.h:595
GAME_MEMORY
Game Memory
Definition game.h:614
@ GAME_SIMD_VFPU
SIMD CPU VFPU.
Definition game.h:701
@ GAME_SIMD_VMX128
SIMD CPU VMX128.
Definition game.h:671
@ GAME_SIMD_SSE
SIMD CPU SSE.
Definition game.h:662
@ GAME_SIMD_SSE4
SIMD CPU SSE4.
Definition game.h:692
@ GAME_SIMD_NEON
SIMD CPU NEON.
Definition game.h:677
@ GAME_SIMD_AVX2
SIMD CPU AVX2.
Definition game.h:698
@ GAME_SIMD_SSE42
SIMD CPU SSE42.
Definition game.h:695
@ GAME_SIMD_SSSE3
SIMD CPU SSSE3.
Definition game.h:683
@ GAME_SIMD_SSE2
SIMD CPU SSE2.
Definition game.h:665
@ GAME_SIMD_SSE3
SIMD CPU SSE3.
Definition game.h:680
@ GAME_SIMD_AVX
SIMD CPU AVX.
Definition game.h:674
@ GAME_SIMD_MMXEXT
SIMD CPU MMXEXT.
Definition game.h:689
@ GAME_SIMD_MMX
SIMD CPU MMX.
Definition game.h:686
@ GAME_SIMD_VMX
SIMD CPU VMX.
Definition game.h:668
@ GAME_REGION_NTSC
Game region NTSC.
Definition game.h:582
@ GAME_REGION_PAL
Game region PAL.
Definition game.h:585
@ GAME_REGION_UNKNOWN
Game region unknown.
Definition game.h:579
@ SPECIAL_GAME_TYPE_SUPER_GAME_BOY
Game Type super game boy.
Definition game.h:606
@ SPECIAL_GAME_TYPE_BSX
Game Type BSX.
Definition game.h:597
@ SPECIAL_GAME_TYPE_BSX_SLOTTED
Game Type BSX slotted.
Definition game.h:600
@ SPECIAL_GAME_TYPE_SUFAMI_TURBO
Game Type sufami turbo.
Definition game.h:603
@ GAME_MEMORY_SNES_SUFAMI_TURBO_A_RAM
Special memory type.
Definition game.h:644
@ GAME_MEMORY_VIDEO_RAM
Video ram lets a frontend peek into a game systems video RAM (VRAM)
Definition game.h:635
@ GAME_MEMORY_SNES_SUFAMI_TURBO_B_RAM
Special memory type.
Definition game.h:647
@ GAME_MEMORY_SNES_GAME_BOY_RTC
Special memory type.
Definition game.h:653
@ GAME_MEMORY_SNES_BSX_PRAM
Special memory type.
Definition game.h:641
@ 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:617
@ GAME_MEMORY_SAVE_RAM
Regular save ram.
Definition game.h:624
@ GAME_MEMORY_SYSTEM_RAM
System ram lets a frontend peek into a game systems main RAM.
Definition game.h:632
@ GAME_MEMORY_SNES_BSX_RAM
Special memory type.
Definition game.h:638
@ GAME_MEMORY_RTC
Some games have a built-in clock to keep track of time.
Definition game.h:629
@ GAME_MEMORY_SNES_GAME_BOY_RAM
Special memory type.
Definition game.h:650
bool cache_context
If this is true, the frontend will go very far to avoid resetting context in scenarios like toggling ...
Definition game.h:374
unsigned int version_minor
Minor version number for core GL context or GLES 3.1+.
Definition game.h:361
bool depth
Set if render buffers should have depth component attached.
Definition game.h:338
unsigned int version_major
Major version number for core GL context or GLES 3.1+.
Definition game.h:358
bool bottom_left_origin
Use conventional bottom-left origin convention.
Definition game.h:355
GAME_HW_CONTEXT_TYPE context_type
The API to use.
Definition game.h:332
bool debug_context
Creates a debug context.
Definition game.h:377
bool stencil
Set if stencil buffers should be attached.
Definition game.h:347
void(* game_proc_address_t)(void)
Hardware framebuffer process function address
Definition game.h:417
GAME_HW_CONTEXT_TYPE
Hardware framebuffer type
Definition game.h:297
@ GAME_HW_CONTEXT_OPENGLES2
OpenGL ES 2.0.
Definition game.h:305
@ GAME_HW_CONTEXT_OPENGL_CORE
Modern desktop core GL context. Use major/minor fields to set GL version.
Definition game.h:308
@ GAME_HW_CONTEXT_VULKAN
Vulkan.
Definition game.h:317
@ GAME_HW_CONTEXT_OPENGLES_VERSION
OpenGL ES 3.1+. Set major/minor fields.
Definition game.h:314
@ GAME_HW_CONTEXT_OPENGLES3
OpenGL ES 3.0.
Definition game.h:311
@ GAME_HW_CONTEXT_NONE
None context.
Definition game.h:299
@ GAME_HW_CONTEXT_OPENGL
OpenGL 2.x. Driver can choose to use latest compatibility context.
Definition game.h:302
Hardware rendering properties
Definition game.h:329
Hardware framebuffer buffer
Definition game.h:398
Hardware framebuffer packet
Definition game.h:408
Hardware framebuffer properties
Definition game.h:389
game_stream_video_packet game_stream_sw_framebuffer_packet
Software framebuffer packet
Definition game.h:453
game_stream_video_properties game_stream_sw_framebuffer_properties
Game software framebuffer stream properties
Definition game.h:434
Software framebuffer type
Definition game.h:441
GAME_STREAM_TYPE type
The stream type.
Definition game.h:496
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:469
@ GAME_STREAM_VIDEO
Video stream.
Definition game.h:477
@ GAME_STREAM_AUDIO
Audio stream.
Definition game.h:474
@ GAME_STREAM_HW_FRAMEBUFFER
Hardware framebuffer.
Definition game.h:480
@ GAME_STREAM_UNKNOWN
Unknown.
Definition game.h:471
@ GAME_STREAM_SW_FRAMEBUFFER
Software framebuffer.
Definition game.h:483
Stream buffers for hardware rendering and zero-copy support
Definition game.h:519
Stream packet and ephemeral metadata
Definition game.h:542
Immutable stream metadata
Definition game.h:494
float aspect_ratio
On video stream used aspect ration.
Definition game.h:256
const uint8_t * data
Pointer for video stream data given to Kodi.
Definition game.h:277
size_t size
Size of data array.
Definition game.h:280
unsigned int nominal_width
The nominal used width.
Definition game.h:242
unsigned int max_height
The maximal used height.
Definition game.h:251
GAME_VIDEO_ROTATION rotation
Width GAME_VIDEO_ROTATION defined rotation angle.
Definition game.h:274
unsigned int height
Video width.
Definition game.h:271
unsigned int max_width
The maximal used width.
Definition game.h:248
unsigned int width
Video height.
Definition game.h:268
GAME_PIXEL_FORMAT format
The stream's pixel format.
Definition game.h:239
unsigned int nominal_height
The nominal used height.
Definition game.h:245
GAME_PIXEL_FORMAT
Pixel format
Definition game.h:196
GAME_VIDEO_ROTATION
Video rotation position
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° and 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:266
Game video stream properties
Definition game.h:237
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 method that was called 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 that the frontend called is not implemented
Definition game.h:36
Game instance.
Definition game.h:1297
Game properties.
Definition game.h:1144
const char ** resource_directories
The "system" directories of the frontend.
Definition game.h:1166
unsigned int proxy_dll_count
Number of proxy DLL paths provided.
Definition game.h:1158
const char * profile_directory
The writable directory of the frontend.
Definition game.h:1179
const char * game_client_dll_path
The path of the game client being loaded.
Definition game.h:1148
unsigned int extension_count
Number of extensions provided.
Definition game.h:1194
bool supports_vfs
The value of the <supports_vfs> property from addon.xml.
Definition game.h:1184
const char ** proxy_dll_paths
Paths to proxy DLLs used to load the game client.
Definition game.h:1153
const char ** extensions
The extensions in the <extensions> property from addon.xml.
Definition game.h:1189
unsigned int resource_directory_count
Number of resource directories provided.
Definition game.h:1171
Game callbacks.
Definition game.h:1210
Game function hooks.
Definition game.h:1234