| 7 | #include <imgui.h> |
| 8 | |
| 9 | DebugView::DebugView(std::string_view title, std::initializer_list<DebugEntry> entries) : title(title) { |
| 10 | data.reserve(entries.size()); |
| 11 | indicesByLabel.reserve(entries.size()); |
| 12 | |
| 13 | for (const auto& e : entries) { |
| 14 | const size_t index = data.size(); |
| 15 | Storage storage = (e.type == DebugDisplayType::Series) ? Storage{std::deque<float>{}} : Storage{std::any{}}; |
| 16 | |
| 17 | data.emplace_back(DebugData{e, std::move(storage)}); |
| 18 | indicesByLabel.emplace(e.label, index); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | DebugView::DebugView(std::string_view title, CustomDrawFn customDraw) : title(title), customDraw_(std::move(customDraw)) {} |
| 23 | |