Skip to content

Commit

Permalink
Fix ImGUI ini file path
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Sep 9, 2024
1 parent b83c042 commit 2f1c0b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ void GUI::Run() {
MINIMUM_WINDOW_SIZE.x * dpiScaling,
MINIMUM_WINDOW_SIZE.y * dpiScaling,
});
ImGui::GetIO().IniFilename = "test";
platform.SetupFonts(&ImGui::GetIO());

sf::Clock deltaClock {};
Expand Down
15 changes: 13 additions & 2 deletions src/windows/PlatformGUI.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright 2023 Fred Emmott <[email protected]>
// SPDX-License-Identifier: ISC

#include <Windows.h>

#include <Unknwn.h>
#include <Windows.h>

#include <winrt/base.h>

Expand Down Expand Up @@ -36,6 +35,18 @@ class PlatformGUI_Windows final : public PlatformGUI {
}

void SetWindow(sf::WindowHandle handle) override {
{
static std::once_flag sOnce;

std::call_once(sOnce, []() {
static std::string sIniPath;
sIniPath = (GetKnownFolderPath<FOLDERID_LocalAppData>()
/ "OpenXR API Layers GUI" / "imgui.ini")
.string();
ImGui::GetIO().IniFilename = sIniPath.c_str();
});
}

{
ShowWindow(handle, SW_HIDE);
BOOL darkMode = true;
Expand Down

0 comments on commit 2f1c0b3

Please sign in to comment.