aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-03-21 20:15:11 +0100
committerraysan5 <raysan5@gmail.com>2016-03-21 20:15:11 +0100
commit269b120104f468df5f0f00ac3a173770aa5bf09f (patch)
tree923e2de3ad58953f1fcadb75009e7e49654b54cd /src
parent584e74c6765b63cf6b618f3c38214c3d49322cc2 (diff)
downloadraylib-269b120104f468df5f0f00ac3a173770aa5bf09f.tar.gz
raylib-269b120104f468df5f0f00ac3a173770aa5bf09f.zip
Review Android button inputs
Diffstat (limited to 'src')
-rw-r--r--src/core.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core.c b/src/core.c
index 37d4a0bf..c05de93b 100644
--- a/src/core.c
+++ b/src/core.c
@@ -146,10 +146,12 @@ static bool windowMinimized = false;
#elif defined(PLATFORM_ANDROID)
static struct android_app *app; // Android activity
static struct android_poll_source *source; // Android events polling source
-static int ident, events;
+static int ident, events; // Android ALooper_pollAll() variables
+
static bool windowReady = false; // Used to detect display initialization
static bool appEnabled = true; // Used to detec if app is active
static bool contextRebindRequired = false; // Used to know context rebind required
+
static int previousButtonState[128] = { 1 }; // Required to check if button pressed/released once
static int currentButtonState[128] = { 1 }; // Required to check if button pressed/released once
#elif defined(PLATFORM_RPI)
@@ -401,13 +403,6 @@ void InitWindow(int width, int height, struct android_app *state)
TraceLog(INFO, "Android app initialized successfully");
- // Init button states values (default up)
- for(int i = 0; i < 128; i++)
- {
- currentButtonState[i] = 1;
- previousButtonState[i] = 1;
- }
-
// Wait for window to be initialized (display and context)
while (!windowReady)
{