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

Sync Hazelnut window title with active scene name #528

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dr01d3k4
Copy link
Contributor

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 callls glfwSetWindowTitle
  • 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 816baa3 in physics branch
  • Consolidated changing which scene is active into a method EditorLayer::SetActiveScene()
  • Changed EditorLayer::OnAttach() to use NewScene() and OpenScene() methods. This did introduced an awkward issue with m_ViewportSize, as SetActiveScene() tries to resize the viewport in the active scene, but during OnAttach() 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

@TheCherno TheCherno mentioned this pull request Jun 28, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant