summaryrefslogtreecommitdiffhomepage
path: root/src/rcore_android.c
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-09 11:07:02 +0200
committerRay <[email protected]>2023-10-09 11:07:02 +0200
commitb55cf40b910a428cba7e69ea9133d555a63b818b (patch)
tree99dc84483f7c9e21a2f2f4dea6a3acfb3181bedd /src/rcore_android.c
parenta38afcf0537ccb008e772befae3e913820f51b76 (diff)
downloadraylib-b55cf40b910a428cba7e69ea9133d555a63b818b.tar.gz
raylib-b55cf40b910a428cba7e69ea9133d555a63b818b.zip
Format tweaks
Diffstat (limited to 'src/rcore_android.c')
-rw-r--r--src/rcore_android.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/rcore_android.c b/src/rcore_android.c
index bd0674b2..a3db7e5f 100644
--- a/src/rcore_android.c
+++ b/src/rcore_android.c
@@ -1,6 +1,6 @@
/**********************************************************************************************
*
-* rcore_android - Functions to manage window, graphics device and inputs
+* rcore_android - Functions to manage window, graphics device and inputs
*
* PLATFORM: ANDROID
* - Android (ARM, ARM64)
@@ -48,13 +48,13 @@
#include "rcore.h"
-//#include <android/sensor.h> // Required for: Android sensors functions (accelerometer, gyroscope, light...)
-#include <android/window.h> // Required for: AWINDOW_FLAG_FULLSCREEN definition and others
#include <android_native_app_glue.h> // Required for: android_app struct and activity management
+#include <android/window.h> // Required for: AWINDOW_FLAG_FULLSCREEN definition and others
+//#include <android/sensor.h> // Required for: Android sensors functions (accelerometer, gyroscope, light...)
#include <jni.h> // Required for: JNIEnv and JavaVM [Used in OpenURL()]
#include <EGL/egl.h> // Native platform windowing system interface
-
+
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
@@ -64,7 +64,7 @@ typedef struct {
struct android_poll_source *source; // Android events polling source
bool appEnabled; // Flag to detect if app is active ** = true
bool contextRebindRequired; // Used to know context rebind required
-
+
// Display data
EGLDisplay device; // Native display device (physical screen connection)
EGLSurface surface; // Surface to draw on, framebuffers (connected to context)
@@ -94,7 +94,7 @@ static GamepadButton AndroidTranslateGamepadButton(int button);
// NOTE: Functions declaration is provided by raylib.h
//----------------------------------------------------------------------------------
-// Module Functions Definition
+// Module Functions Definition: Application
//----------------------------------------------------------------------------------
// To allow easier porting to android, we allow the user to define a
@@ -188,6 +188,8 @@ void InitWindow(int width, int height, const char *title)
CORE.Window.currentFbo.width = width;
CORE.Window.currentFbo.height = height;
+ // Platform specific init window
+ //--------------------------------------------------------------
// Set desired windows flags before initializing anything
ANativeActivity_setWindowFlags(platform.app->activity, AWINDOW_FLAG_FULLSCREEN, 0); //AWINDOW_FLAG_SCALED, AWINDOW_FLAG_DITHER
@@ -269,6 +271,8 @@ void CloseWindow(void)
timeEndPeriod(1); // Restore time period
#endif
+ // Platform specific close window
+ //--------------------------------------------------------------
// Close surface, context and display
if (platform.device != EGL_NO_DISPLAY)
{
@@ -289,6 +293,7 @@ void CloseWindow(void)
eglTerminate(platform.device);
platform.device = EGL_NO_DISPLAY;
}
+ //--------------------------------------------------------------
#if defined(SUPPORT_EVENTS_AUTOMATION)
RL_FREE(events);
@@ -586,7 +591,7 @@ double GetTime(void)
unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec;
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
-
+
return time;
}