Use Win32 runtime binding for thread control

This commit is contained in:
2026-06-17 11:41:51 +02:00
parent 9602196e99
commit a1031b3af1
4 changed files with 18 additions and 4 deletions

View File

@@ -7,6 +7,7 @@
#include "platform_windows/windows_lifecycle_state.h"
#include "platform_windows/windows_main_window_session.h"
#include "platform_windows/windows_runtime_shell.h"
#include "platform_windows/windows_runtime_state.h"
#include "platform_windows/windows_stylus_input.h"
namespace pp::platform::windows {
@@ -19,10 +20,14 @@ void request_window_close(HWND hWnd)
void handle_window_close_message(VrShellState& vr)
{
auto* app = bound_app();
auto* runtime = retained_bound_runtime();
mark_lifecycle_stopped();
request_stop_and_join_vr_thread(vr);
app->runtime().ui_thread_stop();
app->runtime().render_thread_stop();
if (runtime)
{
runtime->ui_thread_stop();
runtime->render_thread_stop();
}
app->terminate();
release_bound_app();
PostQuitMessage(0);

View File

@@ -30,9 +30,11 @@ void register_touch_window(HWND hWnd)
void initialize_runtime_threads()
{
auto* app = bound_app();
auto* runtime = retained_bound_runtime();
assert(runtime);
mark_lifecycle_running();
app->runtime().render_thread_start(*app);
app->runtime().ui_thread_start(*app);
runtime->render_thread_start(*app);
runtime->ui_thread_start(*app);
}
void install_debug_gl_callbacks()