Add build option to show the Dear Imgui demo window in the headset for debugging

This commit is contained in:
Guillaume Meunier
2024-11-01 11:40:33 +01:00
parent 6c10a9ee95
commit 4baff267f6
5 changed files with 18 additions and 1 deletions
+6
View File
@@ -740,6 +740,12 @@ void imgui_context::new_frame(XrTime display_time)
draw_list->AddCircle(position_distance->first, radius * 1.2, ImGui::GetColorU32(ImVec4(0, 0, 0, alpha)), 0, radius * 0.4);
}
#if WIVRN_SHOW_IMGUI_DEMO_WINDOW
if (show_demo_window)
ImGui::ShowDemoWindow(&show_demo_window);
#endif
image_index = swapchain.acquire();
swapchain.wait();
}
+5
View File
@@ -20,6 +20,7 @@
#include "xr/hand_tracker.h"
#include "xr/swapchain.h"
#include "wivrn_config.h"
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <imgui.h>
@@ -135,6 +136,10 @@ private:
ImVector<ImWchar> glyph_ranges;
bool glyph_range_dirty = true;
#if WIVRN_SHOW_IMGUI_DEMO_WINDOW
bool show_demo_window = true;
#endif
void initialize_fonts();
public: