Extract Win32 runtime state storage

This commit is contained in:
2026-06-17 11:34:14 +02:00
parent ba94785eda
commit 0cf6a6ea4f
6 changed files with 66 additions and 17 deletions

View File

@@ -0,0 +1,34 @@
#include "pch.h"
#include "platform_windows/windows_runtime_state.h"
#include "app.h"
#include "wacom.h"
namespace pp::platform::windows {
namespace {
struct RetainedWindowsRuntimeState final {
std::unique_ptr<App> owned_app;
WacomTablet tablet;
};
[[nodiscard]] RetainedWindowsRuntimeState& retained_runtime_state() noexcept
{
static RetainedWindowsRuntimeState state;
return state;
}
}
std::unique_ptr<App>& retained_owned_app() noexcept
{
return retained_runtime_state().owned_app;
}
WacomTablet& retained_wacom_tablet() noexcept
{
return retained_runtime_state().tablet;
}
}