Thin node loader, Win32 wrappers, and canvas mode shells

This commit is contained in:
2026-06-17 00:10:39 +02:00
parent acee4db356
commit 371095770d
9 changed files with 302 additions and 289 deletions

View File

@@ -19,76 +19,7 @@
#include "wacom.h"
#include "abr.h"
namespace pp::platform::windows {
void set_async_render_context(HDC hdc, HGLRC hrc);
void lock_async_render_context();
bool try_lock_async_render_context();
void unlock_async_render_context();
void swap_async_render_context();
RetainedState& retained_state();
}
using pp::platform::windows::retained_state;
HWND pp_windows_main_window_handle()
{
return retained_state().hWnd;
}
void destroy_window()
{
pp::platform::windows::enqueue_main_thread_task(std::packaged_task<void()>([hWnd = retained_state().hWnd] {
pp::platform::windows::request_window_close(hWnd);
}));
}
void async_lock()
{
pp::platform::windows::lock_async_render_context();
}
bool async_lock_try()
{
return pp::platform::windows::try_lock_async_render_context();
}
void win32_async_swap()
{
pp::platform::windows::swap_async_render_context();
}
void async_unlock()
{
pp::platform::windows::unlock_async_render_context();
}
void win32_update_stylus(float dt)
{
pp::platform::windows::update_stylus_frame(dt);
}
void win32_update_fps(int frames)
{
auto& state = 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);
}));
}
bool win32_vr_start()
{
auto& state = retained_state();
return pp::platform::windows::start_window_vr(state.vr, state.sandboxed);
}
void win32_vr_stop()
{
pp::platform::windows::stop_window_vr(retained_state().vr);
}
void win32_save_window_state()
{
pp::platform::windows::save_window_preferences(retained_state().hWnd);
}
int main(int argc, char** argv)
{
auto& state = retained_state();