add imgui input experiment flag

This commit is contained in:
scawful
2023-11-18 00:02:07 -05:00
parent 299770922c
commit b5ce6b96d7
3 changed files with 21 additions and 4 deletions

View File

@@ -208,15 +208,21 @@ absl::Status Controller::CreateRenderer() {
}
absl::Status Controller::CreateGuiContext() const {
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO &io = ImGui::GetIO();
if (flags()->kUseNewImGuiInput) {
io.ConfigFlags |=
ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |=
ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
}
// Initialize ImGui for SDL
ImGui_ImplSDL2_InitForSDLRenderer(window_.get(), renderer_.get());
ImGui_ImplSDLRenderer2_Init(renderer_.get());
// Load available fonts
const ImGuiIO &io = ImGui::GetIO();
// Define constants
static const char *KARLA_REGULAR = "assets/font/Karla-Regular.ttf";
static const char *ROBOTO_MEDIUM = "assets/font/Roboto-Medium.ttf";