mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Android: Added mouse initialization to reset state.
If the app is launched again then the shared object may be reused (on Android).
This commit is contained in:
parent
46cb851018
commit
8d035b1aee
@ -40,9 +40,15 @@
|
|||||||
#define BUTTON_BACK 8
|
#define BUTTON_BACK 8
|
||||||
#define BUTTON_FORWARD 16
|
#define BUTTON_FORWARD 16
|
||||||
|
|
||||||
void Android_OnMouse( int androidButton, int action, float x, float y) {
|
|
||||||
static Uint8 SDLButton;
|
static Uint8 SDLButton;
|
||||||
|
|
||||||
|
void
|
||||||
|
Android_InitMouse(void)
|
||||||
|
{
|
||||||
|
SDLButton = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Android_OnMouse( int androidButton, int action, float x, float y) {
|
||||||
if (!Android_Window) {
|
if (!Android_Window) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "SDL_androidvideo.h"
|
#include "SDL_androidvideo.h"
|
||||||
|
|
||||||
|
extern void Android_InitMouse(void);
|
||||||
extern void Android_OnMouse( int button, int action, float x, float y);
|
extern void Android_OnMouse( int button, int action, float x, float y);
|
||||||
|
|
||||||
#endif /* _SDL_androidmouse_h */
|
#endif /* _SDL_androidmouse_h */
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "SDL_androidclipboard.h"
|
#include "SDL_androidclipboard.h"
|
||||||
#include "SDL_androidevents.h"
|
#include "SDL_androidevents.h"
|
||||||
#include "SDL_androidkeyboard.h"
|
#include "SDL_androidkeyboard.h"
|
||||||
|
#include "SDL_androidmouse.h"
|
||||||
#include "SDL_androidtouch.h"
|
#include "SDL_androidtouch.h"
|
||||||
#include "SDL_androidwindow.h"
|
#include "SDL_androidwindow.h"
|
||||||
|
|
||||||
@ -181,6 +182,8 @@ Android_VideoInit(_THIS)
|
|||||||
|
|
||||||
Android_InitTouch();
|
Android_InitTouch();
|
||||||
|
|
||||||
|
Android_InitMouse();
|
||||||
|
|
||||||
/* We're done! */
|
/* We're done! */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user