diff options
| author | Ray <[email protected]> | 2023-10-13 14:14:16 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-10-13 14:14:16 +0200 |
| commit | 2e65bc675ce2ef92ccc784e25739b27edd7be94b (patch) | |
| tree | 990699cea1923bb5d2f49089b130231249eb3153 /src/rcore_android.c | |
| parent | 876e6b3a0d4db8e6124bf8f95d048879f2f760b1 (diff) | |
| download | raylib-2e65bc675ce2ef92ccc784e25739b27edd7be94b.tar.gz raylib-2e65bc675ce2ef92ccc784e25739b27edd7be94b.zip | |
Moved some platforms functions to generic `rcore` #3313
Reviewed `InitWindow()` to clearly note platform specific code
Diffstat (limited to 'src/rcore_android.c')
| -rw-r--r-- | src/rcore_android.c | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/src/rcore_android.c b/src/rcore_android.c index bfb57fed..7cc71bbc 100644 --- a/src/rcore_android.c +++ b/src/rcore_android.c @@ -183,13 +183,14 @@ void InitWindow(int width, int height, const char *title) CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN CORE.Window.eventWaiting = false; + + // Platform specific init window + //-------------------------------------------------------------- CORE.Window.screen.width = width; CORE.Window.screen.height = height; 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 @@ -227,6 +228,12 @@ void InitWindow(int width, int height, const char *title) // 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"); @@ -311,36 +318,6 @@ bool WindowShouldClose(void) else return true; } -// Check if window is currently hidden -bool IsWindowHidden(void) -{ - return false; -} - -// Check if window has been minimized -bool IsWindowMinimized(void) -{ - return false; -} - -// Check if window has been maximized -bool IsWindowMaximized(void) -{ - return false; -} - -// Check if window has the focus -bool IsWindowFocused(void) -{ - return platform.appEnabled; -} - -// Check if window has been resizedLastFrame -bool IsWindowResized(void) -{ - return false; -} - // Toggle fullscreen mode void ToggleFullscreen(void) { @@ -936,12 +913,14 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) case APP_CMD_GAINED_FOCUS: { platform.appEnabled = true; + CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED; //ResumeMusicStream(); } break; case APP_CMD_PAUSE: break; case APP_CMD_LOST_FOCUS: { platform.appEnabled = false; + CORE.Window.flags |= FLAG_WINDOW_UNFOCUSED; //PauseMusicStream(); } break; case APP_CMD_TERM_WINDOW: |
