Browse Source

Fix screen size check in `InitPlatform()` (#3415)

pull/3417/head
Le Juez Victor 2 years ago
committed by GitHub
parent
commit
2498170b95
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/rcore_android.c

+ 2
- 2
src/rcore_android.c View File

@ -611,7 +611,7 @@ void PollInputEvents(void)
static int InitPlatform(void) static int InitPlatform(void)
{ {
CORE.Window.currentFbo.width = CORE.Window.screen.width; CORE.Window.currentFbo.width = CORE.Window.screen.width;
CORE.Window.currentFbo.height = CORE.Window.screen.width;
CORE.Window.currentFbo.height = CORE.Window.screen.height;
// Set desired windows flags before initializing anything // Set desired windows flags before initializing anything
ANativeActivity_setWindowFlags(platform.app->activity, AWINDOW_FLAG_FULLSCREEN, 0); //AWINDOW_FLAG_SCALED, AWINDOW_FLAG_DITHER ANativeActivity_setWindowFlags(platform.app->activity, AWINDOW_FLAG_FULLSCREEN, 0); //AWINDOW_FLAG_SCALED, AWINDOW_FLAG_DITHER
@ -622,7 +622,7 @@ static int InitPlatform(void)
else if (orientation == ACONFIGURATION_ORIENTATION_LAND) TRACELOG(LOG_INFO, "ANDROID: Window orientation set as landscape"); else if (orientation == ACONFIGURATION_ORIENTATION_LAND) TRACELOG(LOG_INFO, "ANDROID: Window orientation set as landscape");
// TODO: Automatic orientation doesn't seem to work // TODO: Automatic orientation doesn't seem to work
if (width <= height)
if (CORE.Window.screen.width <= CORE.Window.screen.height)
{ {
AConfiguration_setOrientation(platform.app->config, ACONFIGURATION_ORIENTATION_PORT); AConfiguration_setOrientation(platform.app->config, ACONFIGURATION_ORIENTATION_PORT);
TRACELOG(LOG_WARNING, "ANDROID: Window orientation changed to portrait"); TRACELOG(LOG_WARNING, "ANDROID: Window orientation changed to portrait");

Loading…
Cancel
Save