diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-03-13 22:38:01 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-03-13 22:53:53 +0100 |
| commit | 26369a8cdf90320cdd472fdca23ee38f7ce48302 (patch) | |
| tree | 9b67970652adb0c347a9eee53cf15d0f94728f33 | |
| parent | 5812e12d804fc47e1260e52a92e39705e3056364 (diff) | |
Simple debug ui
| -rw-r--r-- | src/main.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index a59254d..56e924d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,6 +19,23 @@ #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; @@ -168,13 +185,7 @@ int main() { wnd.events.clear(); - - ImGui::NewFrame(); - - ImGui::ShowDemoWindow(); - - ImGui::EndFrame(); - + gui((input_data*)renderer.compute_shader_buffer.alloc_info.pMappedData, reset_accumulation); // 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 |
