Thin Windows shell access and bundle quiet validation
This commit is contained in:
@@ -23,7 +23,7 @@ void lock_async_render_context();
|
||||
bool try_lock_async_render_context();
|
||||
void unlock_async_render_context();
|
||||
void swap_async_render_context();
|
||||
RetainedState& retained_state();
|
||||
[[nodiscard]] VrShellState& platform_vr_state() noexcept;
|
||||
}
|
||||
|
||||
void destroy_window();
|
||||
@@ -39,12 +39,12 @@ HWND pp_windows_main_window_handle();
|
||||
|
||||
HWND pp_windows_main_window_handle()
|
||||
{
|
||||
return pp::platform::windows::retained_state().hWnd;
|
||||
return pp::platform::windows::main_window_handle();
|
||||
}
|
||||
|
||||
void destroy_window()
|
||||
{
|
||||
pp::platform::windows::enqueue_main_thread_task(std::packaged_task<void()>([hWnd = pp::platform::windows::retained_state().hWnd] {
|
||||
pp::platform::windows::enqueue_main_thread_task(std::packaged_task<void()>([hWnd = pp::platform::windows::main_window_handle()] {
|
||||
pp::platform::windows::request_window_close(hWnd);
|
||||
}));
|
||||
}
|
||||
@@ -76,26 +76,39 @@ void win32_update_stylus(float dt)
|
||||
|
||||
void win32_update_fps(int frames)
|
||||
{
|
||||
auto& state = pp::platform::windows::retained_state();
|
||||
pp::platform::windows::enqueue_main_thread_task(std::packaged_task<void()>([hWnd = state.hWnd, window_title = state.window_title, &vr = state.vr, frames] {
|
||||
pp::platform::windows::update_window_fps(hWnd, window_title, vr, frames);
|
||||
pp::platform::windows::enqueue_main_thread_task(std::packaged_task<void()>([
|
||||
hWnd = pp::platform::windows::main_window_handle(),
|
||||
window_title = pp::platform::windows::main_window_title(),
|
||||
vr = &pp::platform::windows::platform_vr_state(),
|
||||
frames] {
|
||||
pp::platform::windows::update_window_fps(hWnd, window_title, *vr, frames);
|
||||
}));
|
||||
}
|
||||
|
||||
bool win32_vr_start()
|
||||
{
|
||||
auto& state = pp::platform::windows::retained_state();
|
||||
return pp::platform::windows::start_window_vr(state.vr, state.sandboxed);
|
||||
return pp::platform::windows::start_window_vr(
|
||||
pp::platform::windows::platform_vr_state(),
|
||||
pp::platform::windows::main_window_sandboxed());
|
||||
}
|
||||
|
||||
void win32_vr_stop()
|
||||
{
|
||||
pp::platform::windows::stop_window_vr(pp::platform::windows::retained_state().vr);
|
||||
pp::platform::windows::stop_window_vr(pp::platform::windows::platform_vr_state());
|
||||
}
|
||||
|
||||
void win32_save_window_state()
|
||||
{
|
||||
pp::platform::windows::save_window_preferences(pp::platform::windows::retained_state().hWnd);
|
||||
pp::platform::windows::save_window_preferences(pp::platform::windows::main_window_handle());
|
||||
}
|
||||
|
||||
namespace pp::platform::windows {
|
||||
|
||||
VrShellState& platform_vr_state() noexcept
|
||||
{
|
||||
return retained_state().vr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace pp::platform::windows {
|
||||
@@ -781,7 +794,7 @@ PlatformServices& platform_services()
|
||||
|
||||
VrSessionSnapshot read_platform_vr_session_snapshot() noexcept
|
||||
{
|
||||
return read_vr_session_snapshot(retained_state().vr);
|
||||
return read_vr_session_snapshot(platform_vr_state());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user