Pass Android gamepad key press to virtual key function of example

This commit is contained in:
saschawillems 2016-05-15 11:13:14 +02:00
parent b1a07ddff8
commit de0c29b586
2 changed files with 57 additions and 9 deletions

View file

@ -40,6 +40,14 @@
#include "vulkanTextureLoader.hpp"
#include "vulkanMeshLoader.hpp"
#define GAMEPAD_BUTTON_A 0x1000
#define GAMEPAD_BUTTON_B 0x1001
#define GAMEPAD_BUTTON_X 0x1002
#define GAMEPAD_BUTTON_Y 0x1003
#define GAMEPAD_BUTTON_L1 0x1004
#define GAMEPAD_BUTTON_R1 0x1005
#define GAMEPAD_BUTTON_START 0x1006
class VulkanExampleBase
{
private:
@ -158,15 +166,8 @@ public:
VkImageView view;
} depthStencil;
// OS specific
#if defined(_WIN32)
HWND window;
HINSTANCE windowInstance;
#elif defined(__ANDROID__)
android_app* androidApp;
// true if application has focused, false if moved to background
bool focused = false;
// Gamepad state (only one)
// Gamepad state (only one pad supported)
struct
{
struct
@ -177,6 +178,15 @@ public:
float rz = 0.0f;
} axes;
} gamePadState;
// OS specific
#if defined(_WIN32)
HWND window;
HINSTANCE windowInstance;
#elif defined(__ANDROID__)
android_app* androidApp;
// true if application has focused, false if moved to background
bool focused = false;
#elif defined(__linux__)
struct {
bool left = false;