mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 06:05:36 +00:00
Fixed bug #5221 - Add SDL_AndroidSendMessage()
This commit is contained in:
parent
97269e143d
commit
fe2ed6cf6f
|
@ -425,6 +425,15 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permis
|
|||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
||||
|
||||
/**
|
||||
* Send a user command to SDLActivity
|
||||
* override "boolean onUnhandledMessage(Message msg)" to handle the message
|
||||
*
|
||||
* \param command user command that must be greater or equal to 0x8000
|
||||
* \param param user parameter
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
||||
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
/* Platform specific functions for WinRT */
|
||||
|
|
|
@ -2126,6 +2126,15 @@ void Android_JNI_HapticStop(int device_id)
|
|||
/* See SDLActivity.java for constants. */
|
||||
#define COMMAND_SET_KEEP_SCREEN_ON 5
|
||||
|
||||
|
||||
int SDL_AndroidSendMessage(Uint32 command, int param)
|
||||
{
|
||||
if (command >= 0x8000) {
|
||||
return Android_JNI_SendMessage(command, param);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* sends message to be handled on the UI event dispatch thread */
|
||||
int Android_JNI_SendMessage(int command, int param)
|
||||
{
|
||||
|
|
|
@ -855,3 +855,4 @@
|
|||
#define SDL_GameControllerHasRumbleTriggers SDL_GameControllerHasRumbleTriggers_REAL
|
||||
#define SDL_hid_ble_scan SDL_hid_ble_scan_REAL
|
||||
#define SDL_PremultiplyAlpha SDL_PremultiplyAlpha_REAL
|
||||
#define SDL_AndroidSendMessage SDL_AndroidSendMessage_REAL
|
||||
|
|
|
@ -924,3 +924,4 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerHasRumble,(SDL_GameController *a),(a)
|
|||
SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerHasRumbleTriggers,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_hid_ble_scan,(SDL_bool a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_PremultiplyAlpha,(int a, int b, Uint32 c, const void *d, int e, Uint32 f, void *g, int h),(a,b,c,d,e,f,g,h),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_AndroidSendMessage,(Uint32 a, int b),(a,b),return)
|
||||
|
|
Loading…
Reference in a new issue