Sync Hazelnut window title with active scene name #528
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.
When opening or saving a scene, we now sync the window title with both the scene name and the filepath the scene is saved in.
Window::SetTitle()
which calllsglfwSetWindowTitle
Scene::m_Name
. It can't be changed in the UI yet, only the .hazel scene file. Also updated the demo scenes to have a correct titlem_EditorScenePath
very similarly to how it was added in 816baa3 in physics branchEditorLayer::SetActiveScene()
EditorLayer::OnAttach()
to useNewScene()
andOpenScene()
methods. This did introduced an awkward issue withm_ViewportSize
, asSetActiveScene()
tries to resize the viewport in the active scene, but duringOnAttach()
the viewport size is 0, which leads to the resize methods asserting. The solution taken here was to set the viewport size to a valid value based on how the framebuffer was created before doing new/open scene, then when we go to update/render, it'll be set to the correct value based on how the viewport actually looks.