Added SDL_SetAppMetadata() (#10404)

Removed duplicate hints SDL_HINT_APP_NAME, SDL_HINT_APP_ID, and
SDL_HINT_AUDIO_DEVICE_APP_NAME.

Wired up a few things to use the metadata; more to come!

Fixes https://github.com/libsdl-org/SDL/issues/4703
This commit is contained in:
Sam Lantinga
2024-07-28 07:22:46 -07:00
committed by GitHub
parent 35e42d0a25
commit a36fe632fd
13 changed files with 214 additions and 150 deletions

View File

@@ -158,6 +158,7 @@ SDL3_0.0.0 {
SDL_GetAndroidInternalStoragePath;
SDL_GetAndroidJNIEnv;
SDL_GetAndroidSDKVersion;
SDL_GetAppMetadataProperty;
SDL_GetAssertionHandler;
SDL_GetAssertionReport;
SDL_GetAudioDeviceChannelMap;
@@ -694,6 +695,8 @@ SDL3_0.0.0 {
SDL_SendGamepadEffect;
SDL_SendJoystickEffect;
SDL_SendJoystickVirtualSensorData;
SDL_SetAppMetadata;
SDL_SetAppMetadataProperty;
SDL_SetAssertionHandler;
SDL_SetAudioDeviceGain;
SDL_SetAudioPostmixCallback;

View File

@@ -183,6 +183,7 @@
#define SDL_GetAndroidInternalStoragePath SDL_GetAndroidInternalStoragePath_REAL
#define SDL_GetAndroidJNIEnv SDL_GetAndroidJNIEnv_REAL
#define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL
#define SDL_GetAppMetadataProperty SDL_GetAppMetadataProperty_REAL
#define SDL_GetAssertionHandler SDL_GetAssertionHandler_REAL
#define SDL_GetAssertionReport SDL_GetAssertionReport_REAL
#define SDL_GetAudioDeviceChannelMap SDL_GetAudioDeviceChannelMap_REAL
@@ -719,6 +720,8 @@
#define SDL_SendGamepadEffect SDL_SendGamepadEffect_REAL
#define SDL_SendJoystickEffect SDL_SendJoystickEffect_REAL
#define SDL_SendJoystickVirtualSensorData SDL_SendJoystickVirtualSensorData_REAL
#define SDL_SetAppMetadata SDL_SetAppMetadata_REAL
#define SDL_SetAppMetadataProperty SDL_SetAppMetadataProperty_REAL
#define SDL_SetAssertionHandler SDL_SetAssertionHandler_REAL
#define SDL_SetAudioDeviceGain SDL_SetAudioDeviceGain_REAL
#define SDL_SetAudioPostmixCallback SDL_SetAudioPostmixCallback_REAL

View File

@@ -203,6 +203,7 @@ SDL_DYNAPI_PROC(Uint32,SDL_GetAndroidExternalStorageState,(void),(),return)
SDL_DYNAPI_PROC(const char*,SDL_GetAndroidInternalStoragePath,(void),(),return)
SDL_DYNAPI_PROC(void*,SDL_GetAndroidJNIEnv,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return)
SDL_DYNAPI_PROC(const char*,SDL_GetAppMetadataProperty,(const char *a),(a),return)
SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return)
SDL_DYNAPI_PROC(const SDL_AssertData*,SDL_GetAssertionReport,(void),(),return)
SDL_DYNAPI_PROC(int*,SDL_GetAudioDeviceChannelMap,(SDL_AudioDeviceID a, int *b),(a,b),return)
@@ -730,6 +731,8 @@ SDL_DYNAPI_PROC(int,SDL_SendAndroidMessage,(Uint32 a, int b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SendGamepadEffect,(SDL_Gamepad *a, const void *b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SendJoystickVirtualSensorData,(SDL_Joystick *a, SDL_SensorType b, Uint64 c, const float *d, int e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(int,SDL_SetAppMetadata,(const char *a, const char *b, const char *c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetAppMetadataProperty,(const char *a, const char *b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_SetAssertionHandler,(SDL_AssertionHandler a, void *b),(a,b),)
SDL_DYNAPI_PROC(int,SDL_SetAudioDeviceGain,(SDL_AudioDeviceID a, float b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetAudioPostmixCallback,(SDL_AudioDeviceID a, SDL_AudioPostmixCallback b, void *c),(a,b,c),return)