Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rcore] The content can't be rendered correctly in fullscreen mode. #3965

Closed
archewashi opened this issue May 7, 2024 · 3 comments
Closed

Comments

@archewashi
Copy link

Issue description

Upon calling ToggleFullScreen(), the scale of content doesn't seem correct.
After calling ToggleFullScreen(), other applications with maximized window would be resized to different resolution.

I found that in rcore_desktop.c, the width and height of the parameter in glfwSetWindowMonitor() are as same as the original window screen. This will cause that glfw make the monitor switch to the video mode closest to it, that is, if the window size is (800, 600) and full resolution is (1920, 1080), it will change the video mode to which is closest to (800,600) rather than (1920, 1080).

else
{
CORE.Window.fullscreen = true;
CORE.Window.flags |= FLAG_FULLSCREEN_MODE;
glfwSetWindowMonitor(platform.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
}

@raysan5 Is this an error? I don't see something like this in rcore_desktop_sdl.c.

Environment

Platform backend: DESKTOP (GLFW)
OS: Windows 11 (msys2)

Code Example

example/core_window_flag.c

@archewashi
Copy link
Author

else
{
    CORE.Window.fullscreen = true;
    CORE.Window.flags |= FLAG_FULLSCREEN_MODE;

    const GLFWvidmode *mode = glfwGetVideoMode(monitor);
    glfwSetWindowMonitor(platform.handle, monitor, 0, 0, mode->width, mode->height, GLFW_DONT_CARE);
}

Use the width and height of mode of the monitor can solve it.

@raysan5
Copy link
Owner

raysan5 commented May 7, 2024

Is this an error? I don't see something like this in rcore_desktop_sdl.c.

@archewashi This is not an error but the expected behaviour. When an application requests full-screen exclusive mode, the monitor resolution should match (as close as possible) the application resolution.

If that's not the desired behaviour, then borderless-fullscreen-window should be requested with ToggleBorderlessWindowed() that scales application to monitor resolution.

@archewashi
Copy link
Author

Oh, I see. Thank you, @raysan5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants