Thin Win32 lifecycle close handling
This commit is contained in:
@@ -124,6 +124,9 @@ Latest slice:
|
|||||||
- `src/platform_windows/windows_lifecycle_state.*` now also owns the Win32
|
- `src/platform_windows/windows_lifecycle_state.*` now also owns the Win32
|
||||||
lifecycle close/VR control handoff, so `windows_lifecycle_shell.cpp` is
|
lifecycle close/VR control handoff, so `windows_lifecycle_shell.cpp` is
|
||||||
down to a thinner message adapter over the retained lifecycle state helper.
|
down to a thinner message adapter over the retained lifecycle state helper.
|
||||||
|
- `src/platform_windows/windows_lifecycle_state.*` now also owns the Win32
|
||||||
|
close-message shutdown/quit handoff, so `windows_lifecycle_shell.cpp` is
|
||||||
|
down to a one-line adapter over the retained lifecycle state helper.
|
||||||
- `src/platform_windows/windows_runtime_shell.h` is now a thinner runtime
|
- `src/platform_windows/windows_runtime_shell.h` is now a thinner runtime
|
||||||
entrypoint header that picks up the retained binding surface from
|
entrypoint header that picks up the retained binding surface from
|
||||||
`windows_runtime_state.h` instead of declaring a second shell-owned binding
|
`windows_runtime_state.h` instead of declaring a second shell-owned binding
|
||||||
|
|||||||
@@ -133,6 +133,9 @@ Current slice:
|
|||||||
- `src/platform_windows/windows_lifecycle_state.*` now also owns the Win32
|
- `src/platform_windows/windows_lifecycle_state.*` now also owns the Win32
|
||||||
lifecycle close/VR control handoff, so `windows_lifecycle_shell.cpp` is
|
lifecycle close/VR control handoff, so `windows_lifecycle_shell.cpp` is
|
||||||
down to a thinner message adapter over the retained lifecycle state helper.
|
down to a thinner message adapter over the retained lifecycle state helper.
|
||||||
|
- `src/platform_windows/windows_lifecycle_state.*` now also owns the Win32
|
||||||
|
close-message shutdown/quit handoff, so `windows_lifecycle_shell.cpp` is
|
||||||
|
down to a one-line adapter over the retained lifecycle state helper.
|
||||||
- `src/platform_windows/windows_runtime_shell.h` is thinner again and now
|
- `src/platform_windows/windows_runtime_shell.h` is thinner again and now
|
||||||
imports that binding surface from `windows_runtime_state.h` instead of
|
imports that binding surface from `windows_runtime_state.h` instead of
|
||||||
declaring shell-owned bind/release accessors itself.
|
declaring shell-owned bind/release accessors itself.
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ void request_window_close(HWND hWnd)
|
|||||||
|
|
||||||
void handle_window_close_message(VrShellState& vr)
|
void handle_window_close_message(VrShellState& vr)
|
||||||
{
|
{
|
||||||
shutdown_bound_lifecycle(vr);
|
shutdown_bound_lifecycle_and_quit(vr);
|
||||||
PostQuitMessage(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_stylus_frame(float dt)
|
void update_stylus_frame(float dt)
|
||||||
|
|||||||
@@ -46,6 +46,12 @@ void shutdown_bound_lifecycle(VrShellState& vr)
|
|||||||
shutdown_bound_app_runtime();
|
shutdown_bound_app_runtime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void shutdown_bound_lifecycle_and_quit(VrShellState& vr)
|
||||||
|
{
|
||||||
|
shutdown_bound_lifecycle(vr);
|
||||||
|
PostQuitMessage(0);
|
||||||
|
}
|
||||||
|
|
||||||
bool start_bound_lifecycle_vr(VrShellState& vr, bool sandboxed)
|
bool start_bound_lifecycle_vr(VrShellState& vr, bool sandboxed)
|
||||||
{
|
{
|
||||||
return start_vr_shell(vr, sandboxed, retained_lifecycle_running_state());
|
return start_vr_shell(vr, sandboxed, retained_lifecycle_running_state());
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ void mark_lifecycle_stopped() noexcept;
|
|||||||
[[nodiscard]] bool lifecycle_is_running() noexcept;
|
[[nodiscard]] bool lifecycle_is_running() noexcept;
|
||||||
[[nodiscard]] std::atomic<int>& retained_lifecycle_running_state() noexcept;
|
[[nodiscard]] std::atomic<int>& retained_lifecycle_running_state() noexcept;
|
||||||
void shutdown_bound_lifecycle(VrShellState& vr);
|
void shutdown_bound_lifecycle(VrShellState& vr);
|
||||||
|
void shutdown_bound_lifecycle_and_quit(VrShellState& vr);
|
||||||
[[nodiscard]] bool start_bound_lifecycle_vr(VrShellState& vr, bool sandboxed);
|
[[nodiscard]] bool start_bound_lifecycle_vr(VrShellState& vr, bool sandboxed);
|
||||||
void stop_bound_lifecycle_vr(VrShellState& vr);
|
void stop_bound_lifecycle_vr(VrShellState& vr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user