Skip to content
This repository has been archived by the owner on Feb 16, 2025. It is now read-only.

Commit

Permalink
Surface predicted display time on Frame object (#240)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Adams <msub2official@gmail.com>
  • Loading branch information
msub2 authored Aug 18, 2024
1 parent 08a6d70 commit 474d538
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webxr-api/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ pub struct Frame {

/// The hit test results for this frame, if any
pub hit_test_results: Vec<HitTestResult>,

/// The average point in time this XRFrame is expected to be displayed on the devices' display
pub predicted_display_time: f64,
}

#[derive(Clone, Debug)]
Expand Down
1 change: 1 addition & 0 deletions webxr/glwindow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ impl DeviceAPI for GlWindowDevice {
events: vec![],
sub_images,
hit_test_results: vec![],
predicted_display_time: 0.0,
})
}

Expand Down
1 change: 1 addition & 0 deletions webxr/headless/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ impl HeadlessDeviceData {
events: vec![],
sub_images,
hit_test_results: vec![],
predicted_display_time: 0.0,
}
}

Expand Down
1 change: 1 addition & 0 deletions webxr/openxr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,7 @@ impl DeviceAPI for OpenXrDevice {
events: vec![],
sub_images,
hit_test_results: vec![],
predicted_display_time: frame_state.predicted_display_time.as_nanos() as f64,
};

if let Some(right_select) = right.select {
Expand Down

0 comments on commit 474d538

Please sign in to comment.