diff options
| author | Ray <raysan5@gmail.com> | 2018-02-08 12:24:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-08 12:24:51 +0100 |
| commit | 2ace3602301cf461e50d8108c837f4a040dcf394 (patch) | |
| tree | aa2e1cfa64384f91e09c2eea0ab52cb8d4aac1d8 | |
| parent | 4d5d1e0434497d5755fb596675554a8cee74f9f8 (diff) | |
| parent | a976e76ae644cb10002900519e2a72bd2706348f (diff) | |
| download | raylib-2ace3602301cf461e50d8108c837f4a040dcf394.tar.gz raylib-2ace3602301cf461e50d8108c837f4a040dcf394.zip | |
Merge pull request #462 from a3f/develop
InitWindow: return false if no monitor found
| -rw-r--r-- | src/core.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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; |
