Split Apple platform target and move platform state ownership

This commit is contained in:
2026-06-17 01:03:01 +02:00
parent 5fdc9a9dd6
commit 90a55b86fe
18 changed files with 258 additions and 104 deletions

View File

@@ -12,6 +12,9 @@
#include <GLFW/glfw3.h>
#include "platform_linux/linux_platform_services.h"
#endif
#ifdef _WIN32
#include "platform_windows/windows_platform_services.h"
#endif
#include "platform_legacy/legacy_platform_services.h"
#include "renderer_gl/opengl_capabilities.h"
@@ -435,6 +438,15 @@ void App::report_rendered_frames(int frames)
active_platform_services().report_rendered_frames(frames);
}
VrSessionSnapshot App::vr_session_snapshot() const
{
#ifdef _WIN32
return pp::platform::windows::read_platform_vr_session_snapshot();
#else
return {};
#endif
}
void App::save_prepared_file(
std::string path,
std::string suggested_name,
@@ -655,10 +667,11 @@ bool App::touch_tap(const glm::vec2& pos, int fingers, int tap_count)
}
bool App::key_down(kKey key)
{
const auto vr_session = vr_session_snapshot();
const auto plan = pp::app::plan_app_key_down_dispatch(
layout.get(main_id) != nullptr,
key == kKey::KeySpacebar,
vr_active);
vr_session.vr_active);
if (plan.sync_vr_camera_rotation)
canvas->m_canvas->m_cam_rot = vr_rot;
redraw = plan.request_redraw;