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

Resizable windows start "scaling up" after a point #497

Open
cyberarm opened this issue May 2, 2019 · 5 comments
Open

Resizable windows start "scaling up" after a point #497

cyberarm opened this issue May 2, 2019 · 5 comments

Comments

@cyberarm
Copy link
Collaborator

cyberarm commented May 2, 2019

See video: https://youtu.be/xE2LUiSjiL0

@cyberarm
Copy link
Collaborator Author

cyberarm commented May 2, 2019

Seems to be affected by https://github.com/gosu/gosu/blob/master/src/Window.cpp#L192-L193

// If the window is resizable, limit its size, without preserving the aspect ratio.
width  = actual_width  = min(width,  max_width);
height = actual_height = min(height, max_height);

@jlnr jlnr added the graphics label May 2, 2019
@jlnr
Copy link
Member

jlnr commented May 2, 2019

Whoops, well that's not great. Thanks for reporting!

@jlnr
Copy link
Member

jlnr commented Oct 12, 2019

I have not been able to reproduce any of these issues on macOS, but things seem to be broken in various ways on Linux (elementary, based on Ubuntu 18.04 with SDL 2.0.8).

@jlnr
Copy link
Member

jlnr commented Oct 12, 2019

I think one issue is that SDL_SetWindowSize does not affect maximized (not fullscreen) windows, so Gosu thinks the window size has changed when it hasn't. This might also affect Windows, not sure.

@jlnr
Copy link
Member

jlnr commented Oct 12, 2019

My current plan would be to separate the responsibilities of Window::resize - it should only remember some state and call SDL_SetWindowSize, and the SDL_WINDOWEVENT_SIZE_CHANGED handler should perform the necessary changes to Gosu::Graphics (OpenGL) and Gosu::Input. But I'll go and try to release a new Ruby.app for macOS first before I try something as risky as this refactoring :)

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

No branches or pull requests

2 participants