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:
parent
a18667c2e9
commit
85751a7052
1 changed files with 10 additions and 1 deletions
11
src/rcore.c
11
src/rcore.c
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue