Merge branch 'master' into docking

# Conflicts:
#	backends/imgui_impl_osx.mm
#	backends/imgui_impl_win32.cpp
#	imgui.cpp
#	imgui_internal.h
This commit is contained in:
ocornut
2022-11-04 16:26:15 +01:00
9 changed files with 180 additions and 77 deletions

View File

@@ -9,6 +9,7 @@
#include <android/asset_manager.h>
#include <EGL/egl.h>
#include <GLES3/gl3.h>
#include <string>
// Data
static EGLDisplay g_EglDisplay = EGL_NO_DISPLAY;
@@ -17,6 +18,7 @@ static EGLContext g_EglContext = EGL_NO_CONTEXT;
static struct android_app* g_App = NULL;
static bool g_Initialized = false;
static char g_LogTag[] = "ImGuiExample";
static std::string g_IniFilename = "";
// Forward declarations of helper functions
static int ShowSoftKeyboardInput();
@@ -70,9 +72,10 @@ void init(struct android_app* app)
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
// Disable loading/saving of .ini file from disk.
// FIXME: Consider using LoadIniSettingsFromMemory() / SaveIniSettingsToMemory() to save in appropriate location for Android.
io.IniFilename = NULL;
// Redirect loading/saving of .ini file to our location.
// Make sure 'g_IniFilename' persists while we use Dear ImGui.
g_IniFilename = std::string(app->activity->internalDataPath) + "/imgui.ini";
io.IniFilename = g_IniFilename.c_str();;
// Setup Dear ImGui style
ImGui::StyleColorsDark();