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

@@ -77,6 +77,14 @@ struct VRController
virtual float get_trigger_value() const { return 1.f; }
};
struct VrSessionSnapshot
{
bool has_vr = false;
bool vr_active = false;
std::array<VRController, 2> vr_controllers{};
glm::mat4 vr_head{1.0f};
};
class App
{
public:
@@ -125,7 +133,6 @@ public:
std::string doc_dir;
std::string doc_filename;
bool has_stylus = false;
bool has_vr = false;
bool vr_controllers_enabled = true;
float off_x = 0;
float off_y = 0;
@@ -136,10 +143,7 @@ public:
bool animate = false;
bool ui_visible = true;
bool ui_rtl = false;
bool vr_active = false;
bool vr_only = false;
VRController vr_controllers[2];
glm::mat4 vr_head;
float vr_pressure = 1.f;
glm::mat4 vr_rot{ 0 };
glm::mat4 vr_uirot{ 0 };
@@ -209,6 +213,7 @@ public:
[[nodiscard]] bool platform_enables_live_asset_reloading();
void update_platform_frame(float delta_time_seconds);
void report_rendered_frames(int frames);
[[nodiscard]] VrSessionSnapshot vr_session_snapshot() const;
void save_prepared_file(
std::string path,
std::string suggested_name,