Files
CoopAllTheThings/host/src/imgui_layer.hpp
BlackMark 22b0dff918 Persist ImGui panel layout to disk; quiet audio set_audio_ring log spam
Layout persistence: re-enable io.IniFilename (was nullptr "for the spike"),
anchored to a coop_layout.ini next to the exe so window positions/sizes survive
restarts even when Steam launches us under the donor appid (CWD is unreliable).
Path is UTF-8 for ImGui's file IO. When a saved layout is restored at startup,
suppress the computed-default force so it does not clobber the user's positions;
Reset layout (and a fresh install with no .ini) still applies the default.

Log spam: the worker thread re-attaches every audio ring every tick (idempotent),
and set_audio_ring logged unconditionally, flooding the log. Only log when the
ring pointer actually changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 11:24:23 +02:00

33 lines
676 B
C++

// Owns ImGui setup/teardown for the Win32 + DX11 backends.
#pragma once
#include <string>
#include <d3d11.h>
#include <windows.h>
namespace coop
{
class ImGuiLayer
{
public:
ImGuiLayer() = default;
~ImGuiLayer();
ImGuiLayer(const ImGuiLayer&) = delete;
ImGuiLayer& operator=(const ImGuiLayer&) = delete;
bool init(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* context);
void begin_frame();
void end_frame();
private:
bool initialized_ = false;
// Backing storage for io.IniFilename (ImGui keeps the pointer, not a copy), so the
// layout .ini path must outlive the context. Empty until init() sets it.
std::string ini_path_;
};
} // namespace coop