#pragma once #include #include //from https://eliasdaler.github.io/using-imgui-with-sfml-pt2/ namespace ImGui { static auto vector_getter = [](void* vec, int idx, const char** out_text) { auto& vector = *static_cast*>(vec); if (idx < 0 || idx >= static_cast(vector.size())) { return false; } *out_text = vector.at(idx).c_str(); return true; }; bool Combo(const char* label, int* currIndex, std::vector& values) { if (values.empty()) { return false; } return Combo(label, currIndex, vector_getter, static_cast(&values), values.size()); } bool ListBox(const char* label, int* currIndex, std::vector& values) { if (values.empty()) { return false; } return ListBox(label, currIndex, vector_getter, static_cast(&values), values.size()); } }