summaryrefslogtreecommitdiffhomepage
path: root/src/platforms/rcore_android.c
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-23 19:15:40 +0200
committerRay <[email protected]>2023-10-23 19:15:40 +0200
commita0f00343523a8898dfed46ee21afaa99d0c15f66 (patch)
tree7097c237852e6b7b7f2538002b9fd040eb8711c1 /src/platforms/rcore_android.c
parent3ff60269174d0f264c152875be4d1808b7fe0195 (diff)
downloadraylib-a0f00343523a8898dfed46ee21afaa99d0c15f66.tar.gz
raylib-a0f00343523a8898dfed46ee21afaa99d0c15f66.zip
REVIEWED: `InitPlatform()` organization and code-gardening
Diffstat (limited to 'src/platforms/rcore_android.c')
-rw-r--r--src/platforms/rcore_android.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c
index 1272eecc..4faf73b7 100644
--- a/src/platforms/rcore_android.c
+++ b/src/platforms/rcore_android.c
@@ -518,6 +518,8 @@ void PollInputEvents(void)
// Initialize platform: graphics, inputs and more
int InitPlatform(void)
{
+ // Initialize display basic configuration
+ //----------------------------------------------------------------------------
CORE.Window.currentFbo.width = CORE.Window.screen.width;
CORE.Window.currentFbo.height = CORE.Window.screen.height;
@@ -545,27 +547,33 @@ int InitPlatform(void)
//AConfiguration_getKeyboard(platform.app->config);
//AConfiguration_getScreenSize(platform.app->config);
//AConfiguration_getScreenLong(platform.app->config);
+
+ // Set some default window flags
+ CORE.Window.flags &= ~FLAG_WINDOW_HIDDEN; // false
+ CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // false
+ CORE.Window.flags |= FLAG_WINDOW_MAXIMIZED; // true
+ CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED; // false
+ //----------------------------------------------------------------------------
// Initialize App command system
// NOTE: On APP_CMD_INIT_WINDOW -> InitGraphicsDevice(), InitTimer(), LoadFontDefault()...
+ //----------------------------------------------------------------------------
platform.app->onAppCmd = AndroidCommandCallback;
+ //----------------------------------------------------------------------------
// Initialize input events system
+ //----------------------------------------------------------------------------
platform.app->onInputEvent = AndroidInputCallback;
+ //----------------------------------------------------------------------------
- // Initialize assets manager
- InitAssetManager(platform.app->activity->assetManager, platform.app->activity->internalDataPath);
+ // Initialize storage system
+ //----------------------------------------------------------------------------
+ InitAssetManager(platform.app->activity->assetManager, platform.app->activity->internalDataPath); // Initialize assets manager
+
+ CORE.Storage.basePath = platform.app->activity->internalDataPath; // Define base path for storage
+ //----------------------------------------------------------------------------
- // Initialize base path for storage
- CORE.Storage.basePath = platform.app->activity->internalDataPath;
-
- // Set some default window flags
- CORE.Window.flags &= ~FLAG_WINDOW_HIDDEN; // false
- CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // false
- CORE.Window.flags |= FLAG_WINDOW_MAXIMIZED; // true
- CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED; // false
-
- TRACELOG(LOG_INFO, "PLATFORM: ANDROID: Application initialized successfully");
+ TRACELOG(LOG_INFO, "PLATFORM: ANDROID: Initialized successfully");
// Android ALooper_pollAll() variables
int pollResult = 0;
@@ -613,7 +621,6 @@ void ClosePlatform(void)
}
}
-
// Initialize display device and framebuffer
// NOTE: width and height represent the screen (framebuffer) desired size, not actual display size
// If width or height are 0, default display size will be used for framebuffer size