Pārlūkot izejas kodu

InitWindow: return false if no monitor found

Otherwise we run into an assertion failure inside GLFW's glfwGetVideoMode.
Example:
http://www.cpantesters.org/cpan/report/b4ba5894-0bdb-11e8-841e-2c60b04e1d2d

This is related to #456.
pull/462/head
Ahmad Fatoum pirms 6 gadiem
vecāks
revīzija
a976e76ae6
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: C3EAC3DE9321D59B
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. +7
    -1
      src/core.c

+ 7
- 1
src/core.c Parādīt failu

@ -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;

Notiek ielāde…
Atcelt
Saglabāt