diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index ff1d924b..a5c07dbf 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -70,6 +70,10 @@ What is already real: - `pp_app_core` Latest slice: +- `src/platform_windows/windows_platform_services.cpp` now owns the retained + Win32 VR shell state directly behind `platform_vr_state()`. +- `src/platform_windows/windows_window_shell.cpp` no longer exposes or owns a + separate `retained_vr_shell_state()` pocket. - `src/platform_windows/windows_lifecycle_state.*` now owns the retained Win32 lifecycle running flag and FPS-title scratch buffer instead of leaving them inside `windows_lifecycle_shell.cpp`. diff --git a/docs/modernization/tasks.md b/docs/modernization/tasks.md index f1a8cfca..631d93c4 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -78,6 +78,10 @@ Completed, blocked, and superseded task history moved to the queue is now ordered by code movement instead. Current slice: +- `src/platform_windows/windows_platform_services.cpp` now owns the retained + Win32 VR shell state directly behind `platform_vr_state()`. +- `src/platform_windows/windows_window_shell.cpp` no longer keeps a separate + retained VR shell-state accessor. - `src/platform_windows/windows_lifecycle_state.*` now owns the retained Win32 lifecycle running flag and FPS-title scratch buffer. - `src/platform_windows/windows_lifecycle_shell.cpp` no longer carries that diff --git a/src/platform_windows/windows_platform_services.cpp b/src/platform_windows/windows_platform_services.cpp index a2497454..c24efc7e 100644 --- a/src/platform_windows/windows_platform_services.cpp +++ b/src/platform_windows/windows_platform_services.cpp @@ -20,10 +20,6 @@ #include #include -namespace pp::platform::windows { -[[nodiscard]] VrShellState& platform_vr_state() noexcept; -} - void destroy_window(); void async_lock(); void async_unlock(); @@ -134,7 +130,8 @@ void initialize_retained_input_state() VrShellState& platform_vr_state() noexcept { - return retained_vr_shell_state(); + static VrShellState state; + return state; } } diff --git a/src/platform_windows/windows_platform_services.h b/src/platform_windows/windows_platform_services.h index 9c86f8b5..a5a6b9f0 100644 --- a/src/platform_windows/windows_platform_services.h +++ b/src/platform_windows/windows_platform_services.h @@ -5,10 +5,12 @@ #include struct VrSessionSnapshot; +struct VrShellState; namespace pp::platform::windows { [[nodiscard]] PlatformServices& platform_services(); +[[nodiscard]] VrShellState& platform_vr_state() noexcept; [[nodiscard]] VrSessionSnapshot read_platform_vr_session_snapshot() noexcept; void enqueue_main_thread_task(std::packaged_task task); void drain_main_thread_tasks(); diff --git a/src/platform_windows/windows_window_shell.cpp b/src/platform_windows/windows_window_shell.cpp index b6873c77..7378bc5f 100644 --- a/src/platform_windows/windows_window_shell.cpp +++ b/src/platform_windows/windows_window_shell.cpp @@ -60,12 +60,6 @@ void synchronize_app_key_state_from_keyboard(App& app) } -pp::platform::windows::VrShellState& pp::platform::windows::retained_vr_shell_state() noexcept -{ - static pp::platform::windows::VrShellState state; - return state; -} - LRESULT CALLBACK main_window_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { auto* app = bound_app(); @@ -75,7 +69,7 @@ LRESULT CALLBACK main_window_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) switch (msg) { case kUserCloseMessage: - handle_window_close_message(retained_vr_shell_state()); + handle_window_close_message(pp::platform::windows::platform_vr_state()); return 0; case WM_PAINT: app->redraw = true; diff --git a/src/platform_windows/windows_window_shell.h b/src/platform_windows/windows_window_shell.h index 0c6db7de..48542ce3 100644 --- a/src/platform_windows/windows_window_shell.h +++ b/src/platform_windows/windows_window_shell.h @@ -3,12 +3,10 @@ #include #include "event.h" -#include "platform_windows/windows_vr_shell.h" namespace pp::platform::windows { void initialize_retained_input_state(); -pp::platform::windows::VrShellState& retained_vr_shell_state() noexcept; LRESULT CALLBACK main_window_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp); }