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

Allow window size larger than screen #692

Open
moritz-h opened this issue Feb 1, 2021 · 3 comments
Open

Allow window size larger than screen #692

moritz-h opened this issue Feb 1, 2021 · 3 comments
Assignees
Labels

Comments

@moritz-h
Copy link
Member

moritz-h commented Feb 1, 2021

Describe the bug
When starting megamol.exe with a window size larger than screen, the window size will be limited to screen size.
This problem was also found in mmconsole and was fixed within #559. This workaround needs to be implemented within the new frontend. For implementation see:

// Hack for window size larger than screen:
// The width and height for glfwCreateWindow is just a hint for the underlying window manager. Most window
// managers (Windows + Linux/X11) will just resize and maximise the window on the screen, when a size
// larger than the screen is requested. When we do not allow resizing, the window managers seems to use the
// wanted size.
// But we want a resizable window, therefore we need to set the window resizable again. But the second
// problem with window managers is, that window creation is an async task (at least with X11). When we
// immediately after window creation set the window to be resizable again, the automatic resize will happen
// again. We need to delay this to a later point in time (i.e. rendering of first frame).
// The async task problem holds (of course) also for querying the window size with glfwGetWindowSize.
// Calling this right after glfwCreateWindow will just return our values, not the actual window size.
// Therefore here we cannot test for correct window size.

Environment

  • Linux
@moritz-h moritz-h added the bug label Feb 1, 2021
@geringsj
Copy link
Contributor

geringsj commented Mar 7, 2021

This will be easier to manage when views render into FBOs by default.
Then we are free to resize the FBO and (re)open GLFW windows with arbitrary sizes if a simple resize does not work.
Regarding the async issue, i think we could try to sleep() and maybe issue a few fake swap_buffers() or whatever the window system expects to trigger a resize?

@geringsj geringsj mentioned this issue Mar 7, 2021
25 tasks
@geringsj
Copy link
Contributor

As of #889 we can tell views to render in a different resolution than the GLFW window. However, we can not yet write those rendering results into screenshots in that resolution.

@braunms braunms self-assigned this Mar 22, 2022
@geringsj
Copy link
Contributor

A refactor of #782 brought View screenshots of arbitrary size into master. For this to work die View rendering resolution needs to be explicitly set via mmSetViewFramebufferSize(string view, int width, int height), this decouples view resolution from GLFW windows resolution and results in screenshots of views (mmScreenshotEntryPoint(string entrypoint, string filename)) having view resolution. Currently normal screenshots via mmScreenshot(string filename) are pulled from the GL front buffer and thus represent the GLFW window contents/size.

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

No branches or pull requests

4 participants