Code tweaks and comments for Android
This commit is contained in:
parent
becddd7725
commit
c45eeb8024
2 changed files with 9 additions and 5 deletions
13
src/core.c
13
src/core.c
|
@ -314,9 +314,7 @@ static Vector2 mousePosition; // Mouse position on screen
|
||||||
static bool toggleCursorLock = false; // Ask for cursor pointer lock on next click
|
static bool toggleCursorLock = false; // Ask for cursor pointer lock on next click
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
|
||||||
static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen
|
static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PLATFORM_DESKTOP)
|
#if defined(PLATFORM_DESKTOP)
|
||||||
static char **dropFilesPath; // Store dropped files paths as strings
|
static char **dropFilesPath; // Store dropped files paths as strings
|
||||||
|
@ -477,8 +475,6 @@ void InitWindow(int width, int height, void *state)
|
||||||
{
|
{
|
||||||
TraceLog(LOG_INFO, "Initializing raylib (v1.8.0)");
|
TraceLog(LOG_INFO, "Initializing raylib (v1.8.0)");
|
||||||
|
|
||||||
app_dummy();
|
|
||||||
|
|
||||||
screenWidth = width;
|
screenWidth = width;
|
||||||
screenHeight = height;
|
screenHeight = height;
|
||||||
|
|
||||||
|
@ -1495,6 +1491,7 @@ bool IsMouseButtonPressed(int button)
|
||||||
{
|
{
|
||||||
bool pressed = false;
|
bool pressed = false;
|
||||||
|
|
||||||
|
// TODO: Review, gestures could be not supported despite being on Android platform!
|
||||||
#if defined(PLATFORM_ANDROID)
|
#if defined(PLATFORM_ANDROID)
|
||||||
if (IsGestureDetected(GESTURE_TAP)) pressed = true;
|
if (IsGestureDetected(GESTURE_TAP)) pressed = true;
|
||||||
#else
|
#else
|
||||||
|
@ -2748,6 +2745,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
|
||||||
int32_t action = AMotionEvent_getAction(event);
|
int32_t action = AMotionEvent_getAction(event);
|
||||||
unsigned int flags = action & AMOTION_EVENT_ACTION_MASK;
|
unsigned int flags = action & AMOTION_EVENT_ACTION_MASK;
|
||||||
|
|
||||||
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
||||||
GestureEvent gestureEvent;
|
GestureEvent gestureEvent;
|
||||||
|
|
||||||
// Register touch actions
|
// Register touch actions
|
||||||
|
@ -2776,8 +2774,13 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
|
||||||
|
|
||||||
// Gesture data is sent to gestures system for processing
|
// Gesture data is sent to gestures system for processing
|
||||||
ProcessGestureEvent(gestureEvent);
|
ProcessGestureEvent(gestureEvent);
|
||||||
|
#else
|
||||||
|
|
||||||
|
// TODO: Support only simple touch position
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0; // return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#define SUPPORT_TRACELOG // Output tracelog messages
|
#define SUPPORT_TRACELOG // Output tracelog messages
|
||||||
//#define SUPPORT_TRACELOG_DEBUG // Avoid LOG_DEBUG messages tracing
|
//#define SUPPORT_TRACELOG_DEBUG // Avoid LOG_DEBUG messages tracing
|
||||||
|
|
||||||
|
#include "raylib.h" // WARNING: Required for: LogType enum
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID)
|
#if defined(PLATFORM_ANDROID)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue