aboutsummaryrefslogtreecommitdiff
path: root/src/States/SimulationState.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-22 00:22:12 +0200
committerhachem <im@hachem.wtf>2025-08-22 00:22:12 +0200
commit01fadbecbed89afffb18b2cf5cf3972845a7a169 (patch)
tree1faf64e41f4a9b59e8ad6f68363c590dfc089cc4 /src/States/SimulationState.cpp
parent6f72049359651155be62846e7d080d7a5e871096 (diff)
[add]: frame exporting
Diffstat (limited to 'src/States/SimulationState.cpp')
-rw-r--r--src/States/SimulationState.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/States/SimulationState.cpp b/src/States/SimulationState.cpp
index fa3c4f5..d961f9e 100644
--- a/src/States/SimulationState.cpp
+++ b/src/States/SimulationState.cpp
@@ -7,6 +7,9 @@
#include <imgui.h>
#include <GLFW/glfw3.h>
+#include <chrono>
+#include <iomanip>
+#include <sstream>
namespace Donut
{
@@ -230,6 +233,51 @@ namespace Donut
ImGui::Spacing();
+ ImGui::TextColored(ImVec4(0.9f, 0.9f, 1.0f, 1.0f), "Export");
+ ImGui::Separator();
+
+ if (ImGui::Button("Export Frame (1080p)", ImVec2(-1, 30)))
+ {
+ auto& engine = Application::Get().GetEngine();
+ auto now = std::chrono::system_clock::now();
+ auto time_t = std::chrono::system_clock::to_time_t(now);
+ std::stringstream ss;
+ ss << "frame_1080p_" << std::put_time(std::localtime(&time_t), "%Y-%m-%d_%H-%M-%S") << ".png";
+ engine.ExportHighResFrame(ss.str(), 1920, 1080);
+ }
+
+ if (ImGui::Button("Export High-Res Frame (4K)", ImVec2(-1, 30)))
+ {
+ auto& engine = Application::Get().GetEngine();
+ auto now = std::chrono::system_clock::now();
+ auto time_t = std::chrono::system_clock::to_time_t(now);
+ std::stringstream ss;
+ ss << "high_res_frame_4k_" << std::put_time(std::localtime(&time_t), "%Y-%m-%d_%H-%M-%S") << ".png";
+ engine.ExportHighResFrame(ss.str(), 4096, 3072);
+ }
+
+ if (ImGui::Button("Export High-Res Frame (8K)", ImVec2(-1, 30)))
+ {
+ auto& engine = Application::Get().GetEngine();
+ auto now = std::chrono::system_clock::now();
+ auto time_t = std::chrono::system_clock::to_time_t(now);
+ std::stringstream ss;
+ ss << "high_res_frame_8k_" << std::put_time(std::localtime(&time_t), "%Y-%m-%d_%H-%M-%S") << ".png";
+ engine.ExportHighResFrame(ss.str(), 8192, 6144);
+ }
+
+ if (ImGui::Button("Export Ultra High-Res Frame (16K)", ImVec2(-1, 30)))
+ {
+ auto& engine = Application::Get().GetEngine();
+ auto now = std::chrono::system_clock::now();
+ auto time_t = std::chrono::system_clock::to_time_t(now);
+ std::stringstream ss;
+ ss << "high_res_frame_16k_" << std::put_time(std::localtime(&time_t), "%Y%m%d_%H%M%S") << ".png";
+ engine.ExportHighResFrame(ss.str(), 16384, 12288);
+ }
+
+ ImGui::Spacing();
+
ImGui::TextColored(ImVec4(0.9f, 0.9f, 1.0f, 1.0f), "Controls");
ImGui::Separator();