Added function to enable/disable floating joystick

This commit is contained in:
Sergii Pylypenko
2014-06-23 20:26:28 +03:00
parent 60a243fbf1
commit 826a0d34ec
3 changed files with 15 additions and 0 deletions

View File

@@ -594,6 +594,9 @@ int main(int argc, char* argv[])
fps = (float)fps_count * 1000.0 / (tick - fps_start);
fps_count = 0;
fps_start = tick;
static int fj = false;
fj=!fj;
SDL_ANDROID_SetScreenKeyboardFloatingJoystick(fj);
}
print_num(screen, font, screen->w-37, screen->h-12, fps);

View File

@@ -103,6 +103,10 @@ extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonGenerateTouchEven
/* Configure a button to stay pressed after touch, and un-press after second touch, to emulate Ctrl/Alt/Shift keys */
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonStayPressedAfterTouch(int buttonId, int stayPressed);
/* Enable or disable floating joystick, the joystick is hidden after you disable floating joystick,
you should set it's coordinates with SDL_ANDROID_SetScreenKeyboardButtonPos(). */
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardFloatingJoystick(int enabled);
/* Set screen keyboard transparency, 255 or SDL_ALPHA_OPAQUE is non-transparent, 0 or SDL_ALPHA_TRANSPARENT is transparent */
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardTransparency(int alpha);

View File

@@ -1191,6 +1191,14 @@ int SDL_ANDROID_SetScreenKeyboardHintMesage(const char * hint)
return 1;
}
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardFloatingJoystick(int enabled)
{
floatingScreenJoystick = enabled;
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD, 0);
return 1;
}
/**
* @brief Dumps OpenGL state for debugging - typically every capability set with glEnable().
*/