| 1 | /* |
| 2 | =========================================================================== |
| 3 | * Sago Multi Scrambler Puzzle |
| 4 | Copyright (C) 2024 Poul Sander |
| 5 | |
| 6 | This program is free software: you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation, either version 2 of the License, or |
| 9 | (at your option) any later version. |
| 10 | |
| 11 | This program is distributed in the hope that it will be useful, |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | GNU General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with this program. If not, see http://www.gnu.org/licenses/ |
| 18 | |
| 19 | Source information and contacts persons can be found at |
| 20 | https://github.com/sago007/sago_multi_scrambler_puzzle2 |
| 21 | =========================================================================== |
| 22 | */ |
| 23 | |
| 24 | #include "SagoImGui.hpp" |
| 25 | |
| 26 | |
| 27 | |
| 28 | void InitImGui(SDL_Window* window, SDL_Renderer* renderer, int width, int height) { |
| 29 | // Setup Dear ImGui context |
| 30 | IMGUI_CHECKVERSION(); |
| 31 | ImGui::CreateContext(); |
| 32 | ImGuiIO& io = ImGui::GetIO(); (void)io; |
| 33 | io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls |
| 34 | io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls |
| 35 | io.DisplaySize.x = static_cast<float>(width); |
| 36 | io.DisplaySize.y = static_cast<float>(height); |
| 37 | |
| 38 | io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; |
| 39 | |
| 40 | // Setup Dear ImGui style |
| 41 | ImGui::StyleColorsDark(); |
| 42 | //ImGui::StyleColorsLight(); |
| 43 | |
| 44 | // Setup Platform/Renderer backends |
| 45 | ImGui_ImplSDL2_InitForSDLRenderer(window, renderer); |
| 46 | ImGui_ImplSDLRenderer2_Init(renderer); |
| 47 | } |