-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Constrain window aspect ratio in SDL version #1264
Comments
Frustratingly SDL doesn't have the ability to constrain a window's aspect ratio yet despite a patch being provided nine years ago: In the absence of this feature, someone suggested that it could be implemented with various platform-specific code, providing an example of how to do it on macOS: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've built the SDL/OpenGL version of CLK on macOS for comparison with the usual Cocoa/Metal version, and I've noticed that the Cocoa/Metal version ensures the window's aspect ratio stays the same when it is resized. This constraint should be added to the SDL/OpenGL version, because currently it is possible to resize the SDL/OpenGL version's window so that it is either too wide (black bars appear on the left and right of the emulated screen) or too narrow (the left and right of the emulated screen are cut off).
This problem occurs with frustrating regularity because I frequently use Rectangle to put my text editor window on the left half of the screen and the CLK window on the right half of the screen. What I want when I do this is for the CLK window to take up half the width of the screen and however much of the height as would befit the correct aspect ratio, and that is what happens with the Cocoa/Metal version, but with the SDL/OpenGL version, it takes up the full height so emulated screen content is cut off so it's not usable and I have to adjust the window height manually every single time I launch it.
The text was updated successfully, but these errors were encountered: