Extract Win32 runtime state storage
This commit is contained in:
34
src/platform_windows/windows_runtime_state.cpp
Normal file
34
src/platform_windows/windows_runtime_state.cpp
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user