aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 29f9a23a..0a1c34c9 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1733,7 +1733,13 @@ static bool InitGraphicsDevice(int width, int height)
// NOTE: Getting video modes is not implemented in emscripten GLFW3 version
#if defined(PLATFORM_DESKTOP)
// Find monitor resolution
- const GLFWvidmode *mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
+ GLFWmonitor *monitor = glfwGetPrimaryMonitor();
+ if (!monitor)
+ {
+ TraceLog(LOG_WARNING, "Failed to get monitor");
+ return false;
+ }
+ const GLFWvidmode *mode = glfwGetVideoMode(monitor);
displayWidth = mode->width;
displayHeight = mode->height;