summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-04-09 23:50:00 +0200
committerraysan5 <[email protected]>2020-04-09 23:50:00 +0200
commitd419602c99480a69aa3eef0b074bc15f2aa6e413 (patch)
tree0ed50a9ad1c86d1c04891c90406c864799a04d1b /src/core.c
parent926651b708ddfb92d9cc6e331c48a921a85dd8f4 (diff)
downloadraylib-d419602c99480a69aa3eef0b074bc15f2aa6e413.tar.gz
raylib-d419602c99480a69aa3eef0b074bc15f2aa6e413.zip
Review display size init for RPI
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core.c b/src/core.c
index df4a401a..72141968 100644
--- a/src/core.c
+++ b/src/core.c
@@ -2857,7 +2857,6 @@ static bool InitGraphicsDevice(int width, int height)
glfwWindowHint(GLFW_AUTO_ICONIFY, 0);
}
#endif
-
TRACELOG(LOG_WARNING, "SYSTEM: Closest fullscreen videomode: %i x %i", CORE.Window.display.width, CORE.Window.display.height);
// NOTE: ISSUE: Closest videomode could not match monitor aspect-ratio, for example,
@@ -2951,10 +2950,6 @@ static bool InitGraphicsDevice(int width, int height)
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)
CORE.Window.fullscreen = true;
- // Screen size security check
- if (CORE.Window.screen.width <= 0) CORE.Window.screen.width = CORE.Window.display.width;
- if (CORE.Window.screen.height <= 0) CORE.Window.screen.height = CORE.Window.display.height;
-
#if defined(PLATFORM_RPI)
bcm_host_init();
@@ -3157,8 +3152,10 @@ static bool InitGraphicsDevice(int width, int height)
eglQuerySurface(CORE.Window.device, CORE.Window.surface, EGL_WIDTH, &CORE.Window.screen.width);
eglQuerySurface(CORE.Window.device, CORE.Window.surface, EGL_HEIGHT, &CORE.Window.screen.height);
-#else // PLATFORM_ANDROID, PLATFORM_RPI
- EGLint numConfigs;
+#endif // PLATFORM_UWP
+
+#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
+ EGLint numConfigs = 0;
// Get an EGL device connection
CORE.Window.device = eglGetDisplay(EGL_DEFAULT_DISPLAY);
@@ -3194,7 +3191,7 @@ static bool InitGraphicsDevice(int width, int height)
// Create an EGL window surface
//---------------------------------------------------------------------------------
#if defined(PLATFORM_ANDROID)
- EGLint displayFormat;
+ EGLint displayFormat = 0;
// EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is guaranteed to be accepted by ANativeWindow_setBuffersGeometry()
// As soon as we picked a EGLConfig, we can safely reconfigure the ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID
@@ -3212,6 +3209,10 @@ static bool InitGraphicsDevice(int width, int height)
#if defined(PLATFORM_RPI)
graphics_get_display_size(0, &CORE.Window.display.width, &CORE.Window.display.height);
+
+ // Screen size security check
+ if (CORE.Window.screen.width <= 0) CORE.Window.screen.width = CORE.Window.display.width;
+ if (CORE.Window.screen.height <= 0) CORE.Window.screen.height = CORE.Window.display.height;
// At this point we need to manage render size vs screen size
// NOTE: This function use and modify global module variables: CORE.Window.screen.width/CORE.Window.screen.height and CORE.Window.render.width/CORE.Window.render.height and CORE.Window.screenScale