commit d4882816
Initial ImGui for the puzzle editor in the future. This breaks Ubuntu 20.04, so it might take some time to make it to master.
Changed files
| A | source/code/SagoImGui.cpp |
| A | source/code/SagoImGui.hpp |
diff --git a/source/code/SagoImGui.cpp b/source/code/SagoImGui.cpp
new file mode 100644
index 0000000..f76bf22
--- /dev/null
+++ b/source/code/SagoImGui.cpp
@@ -0,0 +1,47 @@
+/*
+===========================================================================
+ * Sago Multi Scrambler Puzzle
+Copyright (C) 2024 Poul Sander
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see http://www.gnu.org/licenses/
+
+Source information and contacts persons can be found at
+https://github.com/sago007/sago_multi_scrambler_puzzle2
+===========================================================================
+*/
+
+#include "SagoImGui.hpp"
+
+
+
+void InitImGui(SDL_Window* window, SDL_Renderer* renderer, int width, int height) {
+ // Setup Dear ImGui context
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ ImGuiIO& io = ImGui::GetIO(); (void)io;
+ io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
+ io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
+ io.DisplaySize.x = static_cast<float>(width);
+ io.DisplaySize.y = static_cast<float>(height);
+
+ io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
+
+ // Setup Dear ImGui style
+ ImGui::StyleColorsDark();
+ //ImGui::StyleColorsLight();
+
+ // Setup Platform/Renderer backends
+ ImGui_ImplSDL2_InitForSDLRenderer(window, renderer);
+ ImGui_ImplSDLRenderer2_Init(renderer);
+}
\ No newline at end of file
diff --git a/source/code/SagoImGui.hpp b/source/code/SagoImGui.hpp
new file mode 100644
index 0000000..0bcac15
--- /dev/null
+++ b/source/code/SagoImGui.hpp
@@ -0,0 +1,32 @@
+/*
+===========================================================================
+ * Sago Multi Scrambler Puzzle
+Copyright (C) 2024 Poul Sander
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see http://www.gnu.org/licenses/
+
+Source information and contacts persons can be found at
+https://github.com/sago007/sago_multi_scrambler_puzzle2
+===========================================================================
+*/
+
+#include "imgui.h"
+#include "backends/imgui_impl_sdl2.h"
+#include "backends/imgui_impl_sdlrenderer2.h"
+#include <SDL2/SDL.h>
+#include <SDL2/SDL_image.h>
+
+
+
+void InitImGui(SDL_Window* window, SDL_Renderer* renderer, int width, int height);
\ No newline at end of file