Hazel
Hazel copied to clipboard
Sync Hazelnut window title with active scene name
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.
- Exposed
Window::SetTitle()
which calllsglfwSetWindowTitle
- Updated SceneSerializer to read/write an actual scene name instead of hardcoded. We store this in
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 title - EditorLayer tracks
m_EditorScenePath
very similarly to how it was added in 816baa3e055f5b8010ebc514a775e2928e032a7f in physics branch - Consolidated changing which scene is active into a method
EditorLayer::SetActiveScene()
- Changed
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.
Impact | Issue/PR |
---|---|
Issues this solves | None |
Other PRs this solves | None |