diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-03-07 20:10:31 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-03-07 20:10:31 +0100 |
| commit | e6d55c22bee063057c0f7b529baff2936e882f3d (patch) | |
| tree | 1a7fe62cde7e2e23a24389f1efe2248aa686e570 /src/main.cpp | |
| parent | 7e572410bb95a46db3bd3955cc7689ea87973cea (diff) | |
Make imgui backend more flexible (display demo scene)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index b824fd4..07e799b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,7 @@ #include <cassert> #include "thirdparty/renderdoc.h" +#include "imgui.h" #include "vk-renderer.hpp" #include "window.hpp" @@ -65,6 +66,8 @@ int main() { start = std::chrono::high_resolution_clock::now(); + ImGuiIO& io = ImGui::GetIO(); + wnd.poll_events(); for (auto event: wnd.events) { @@ -72,9 +75,13 @@ int main() { case EVENT_TYPES::RESIZE: { width = event.width; height = event.height; + ((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->width = width; ((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->height = height; + io.DisplaySize.x = (float)width; + io.DisplaySize.y = (float)height; + if (event.width == 0 && event.height == 0) { canRender = false; } else { @@ -129,6 +136,14 @@ int main() { wnd.events.clear(); + + ImGui::NewFrame(); + + ImGui::ShowDemoWindow(); + + 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 // either no windows at all or only one window, and it will capture from that device. |
