Fix full screen resolution issue

I was writing a image viewer in Raylib and high res images appeared  in the same low resolution as the small window.
Investigating the issue showed that glfwSetWindowMonitor is called with the screen resolution, not the current monitor resolution.

It is possible I am misunderstanding things here and the current work flow is desired for pixelart games with not resizable windows ?
This commit is contained in:
tanolino 2023-05-31 00:34:52 +02:00 committed by GitHub
parent a18667c2e9
commit 85751a7052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1230,9 +1230,18 @@ void ToggleFullscreen(void)
{ {
CORE.Window.fullscreen = true; CORE.Window.fullscreen = true;
CORE.Window.flags |= FLAG_FULLSCREEN_MODE; CORE.Window.flags |= FLAG_FULLSCREEN_MODE;
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
if (!mode)
{
TRACELOG(LOG_WARNING, "GLFW: Failed to get monitor video mode");
glfwSetWindowMonitor(CORE.Window.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE); glfwSetWindowMonitor(CORE.Window.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
} }
else
{
glfwSetWindowMonitor(CORE.Window.handle, monitor, 0, 0, mode->width, mode->height, GLFW_DONT_CARE);
}
}
} }
else else
{ {