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 Editor Window #5779
Merged
Merged
Resizable Editor Window #5779
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Listen for window resize events and recreate offscreen render target if changed - Resizing is opt-in (to allow gradual migration of existing content) - Renderer determines new platform drawable size in pixels - Deprecate Graphics::GetScreenWidth/Height
- Editor window resizes by default - Game window can be resized if setting a debug option in config for now
- All code now queries current window width/height from renderer object - Added TODO/FIXME comments where appropriate
- Event handling is now safe to run at the start of the frame, now that there is no longer a dependency on it from OldUI - Remove associated FIXME comments obsoleted by removal and rewrites of old systems
- Detected with valgrind's "conditional jump depends on unitialized variable" check mode
- Resolves UX issue where the user enters an extension-less filepath and expects it to automatically be treated as a JSON file
This PR now also partially addresses #5746 - I've fixed the missing display of the system when creating a new system, and ensured that saved system files have a .json extension. |
fluffyfreak
approved these changes
Feb 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't spotted any code issues, it looks good and resizeable windows!!! At long last! :D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At long last, we have the technology to resize a window at runtime.
It only took three years by my count.This PR provides support for resizing the editor window using the titlebar / window corners (or any other OS-provided method to resize a window). It also fixes some bugs along the way, adds some more FIXME comments (no delve into the dungeon of the code is complete without at least one new FIXME), and sneakily adds an option to resize the main game window as well - though none of the UI currently resizes along with it.
This PR fully deprecates and deletes Graphics::GetScreenHeight/Width, replacing usage with the Renderer::GetWindowHeight/Width methods instead. In a lot of cases, the original use of the function was suboptimal at best, and future work should be done to refactor those algorithms to use a more appropriate source of screen size information. I'll be leaving that for other contributors to hack on at this juncture.
Fixes #5742.
2024-02-24.00-18-02.mp4