summaryrefslogtreecommitdiff
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/resviewer.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/application/resviewer.cpp b/application/resviewer.cpp
index e0c36f6..0e34c05 100644
--- a/application/resviewer.cpp
+++ b/application/resviewer.cpp
@@ -44,8 +44,9 @@ private:
void
render() override
{
+ const auto & [camFrust, lightFrust] = preFrame(gameState->environment->getSunPos());
SceneRenderer::render(*this);
- controls();
+ controls(camFrust, lightFrust);
}
void
@@ -89,12 +90,12 @@ private:
}
void
- controls()
+ controls(const Frustum & camFrust, const Frustum & lightFrust)
{
if (ImGui::Begin("Resource view")) {
ImGui::SetWindowSize({});
fileSelection();
- assetSelection();
+ assetSelection(camFrust, lightFrust);
}
ImGui::End();
@@ -130,7 +131,7 @@ private:
}
void
- assetSelection()
+ assetSelection(const Frustum & camFrust, const Frustum & lightFrust)
{
if (!gameState->assets.empty()) {
ImGui::BeginListBox("Asset");
@@ -141,7 +142,7 @@ private:
selectedAssetId = asset.first;
selectedAsset = renderable;
location = asset.second->createAt(position);
- renderable->preFrame(camera);
+ renderable->preFrame(camFrust, lightFrust);
}
}
}
@@ -175,6 +176,12 @@ private:
}
}
+ void
+ environment(const SceneShader &, const SceneRenderer & renderer) const override
+ {
+ gameState->environment->render(renderer, *this);
+ }
+
std::span<const std::filesystem::path> fileList;
std::filesystem::file_time_type fileTime;
const std::filesystem::path * selectedFile {};