Added preview window when selecting a camera in the scene

This commit is contained in:
Antoine Pilote
2024-09-04 20:31:43 -04:00
parent e1813870a2
commit e607b99191
9 changed files with 94 additions and 10 deletions

View File

@@ -149,9 +149,6 @@ void Window::Draw()
cam->AspectRatio = size.x / size.y;
float resolutionScale = glm::clamp(Engine::GetProject()->Settings.ResolutionScale, 0.5f, 2.0f);
this->scene->m_EditorCamera->OnWindowResize(size.x * resolutionScale, size.y * resolutionScale);
if (Engine::IsPlayMode())
{
ZoneScopedN("PIE Draw");
@@ -160,6 +157,8 @@ void Window::Draw()
else
{
ZoneScopedN("Non-playmode Draw");
float resolutionScale = glm::clamp(Engine::GetProject()->Settings.ResolutionScale, 0.5f, 2.0f);
this->scene->m_EditorCamera->OnWindowResize(size.x * resolutionScale, size.y * resolutionScale);
this->scene->Draw(*this->framebuffer.get(), this->scene->m_EditorCamera->GetPerspective(), this->scene->m_EditorCamera->GetTransform());
}