aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-03-18 23:28:20 +0100
committerladevieq <ladevie.quentin@gmail.com>2021-03-18 23:28:20 +0100
commitbc1073a020c99ed89967a6b00a9eeb4ab2e160dc (patch)
tree544497c811d3f47217995b0833c25691cdac8d41 /src/main.cpp
parent6c151c00ef2e4f56eedf239341bf320079e1f482 (diff)
Display frame time & add aabb ray hit function for future BVH
implementation
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 56e924d..553191a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -19,24 +19,6 @@
#include <Windows.h>
#endif
-void gui(input_data* mapped_input_data, bool &reset_accumulation) {
- ImGui::NewFrame();
-
- ImGui::SetNextWindowPos({ 0.f, 0.f });
- ImGui::SetNextWindowSize({ 0.f, 0.f });
- ImGui::Begin("Debug", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar);
-
- if (ImGui::SliderInt("samples per pixel", (int32_t*)&mapped_input_data->samples_per_pixel, 1, 1000)) {
- reset_accumulation = true;
- }
-
- ImGui::SliderInt("bounces", (int32_t*)&mapped_input_data->max_bounce, 2, 250);
-
- ImGui::End();
-
- ImGui::EndFrame();
-}
-
int main() {
RENDERDOC_API_1_1_2 *rdoc_api = NULL;
@@ -185,7 +167,24 @@ int main() {
wnd.events.clear();
- gui((input_data*)renderer.compute_shader_buffer.alloc_info.pMappedData, reset_accumulation);
+ // GUI
+ ImGui::NewFrame();
+
+ ImGui::SetNextWindowPos({ 0.f, 0.f });
+ ImGui::SetNextWindowSize({ 0.f, 0.f });
+ ImGui::Begin("Debug", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar);
+
+ ImGui::Text("frame time %f ms\n", delta_time);
+
+ if (ImGui::SliderInt("samples per pixel", (int32_t*)&((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->samples_per_pixel, 1, 1000)) {
+ reset_accumulation = true;
+ }
+
+ ImGui::SliderInt("bounces", (int32_t*)&((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->max_bounce, 2, 250);
+
+ ImGui::End();
+
+ ImGui::EndFrame();
// To start a frame capture, call StartFrameCapture.
// You can specify NULL, NULL for the device to capture on if you have only one device and