Merge pull request #462 from a3f/develop
InitWindow: return false if no monitor found
This commit is contained in:
commit
2ace360230
1 changed files with 7 additions and 1 deletions
|
@ -1733,7 +1733,13 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
// NOTE: Getting video modes is not implemented in emscripten GLFW3 version
|
// NOTE: Getting video modes is not implemented in emscripten GLFW3 version
|
||||||
#if defined(PLATFORM_DESKTOP)
|
#if defined(PLATFORM_DESKTOP)
|
||||||
// Find monitor resolution
|
// 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;
|
displayWidth = mode->width;
|
||||||
displayHeight = mode->height;
|
displayHeight = mode->height;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue