Skip to content

Commit 2f1c0b3

Browse files
committed
Fix ImGUI ini file path
1 parent b83c042 commit 2f1c0b3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/GUI.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ void GUI::Run() {
8585
MINIMUM_WINDOW_SIZE.x * dpiScaling,
8686
MINIMUM_WINDOW_SIZE.y * dpiScaling,
8787
});
88-
ImGui::GetIO().IniFilename = "test";
8988
platform.SetupFonts(&ImGui::GetIO());
9089

9190
sf::Clock deltaClock {};

src/windows/PlatformGUI.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Copyright 2023 Fred Emmott <[email protected]>
22
// SPDX-License-Identifier: ISC
33

4-
#include <Windows.h>
5-
64
#include <Unknwn.h>
5+
#include <Windows.h>
76

87
#include <winrt/base.h>
98

@@ -36,6 +35,18 @@ class PlatformGUI_Windows final : public PlatformGUI {
3635
}
3736

3837
void SetWindow(sf::WindowHandle handle) override {
38+
{
39+
static std::once_flag sOnce;
40+
41+
std::call_once(sOnce, []() {
42+
static std::string sIniPath;
43+
sIniPath = (GetKnownFolderPath<FOLDERID_LocalAppData>()
44+
/ "OpenXR API Layers GUI" / "imgui.ini")
45+
.string();
46+
ImGui::GetIO().IniFilename = sIniPath.c_str();
47+
});
48+
}
49+
3950
{
4051
ShowWindow(handle, SW_HIDE);
4152
BOOL darkMode = true;

0 commit comments

Comments
 (0)