Skip to content

Instantly share code, notes, and snippets.

@MortimerGoro
Last active November 23, 2016 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MortimerGoro/3e75c5925101c31c195c53d82a3b035b to your computer and use it in GitHub Desktop.
Save MortimerGoro/3e75c5925101c31c195c53d82a3b035b to your computer and use it in GitHub Desktop.
VRDisplay DOM struct example
#[dom_struct]
pub struct VRDisplay {
eventtarget: EventTarget,
#[ignore_heap_size_of = "Defined in rust-webvr"]
display: DOMRefCell<WebVRDisplayData>,
depth_near: Cell<f64>,
depth_far: Cell<f64>,
presenting: Cell<bool>,
left_eye_params: MutHeap<JS<VREyeParameters>>,
right_eye_params: MutHeap<JS<VREyeParameters>>,
capabilities: MutHeap<JS<VRDisplayCapabilities>>,
stage_params: MutNullableHeap<JS<VRStageParameters>>,
#[ignore_heap_size_of = "Defined in rust-webvr"]
frame_data: DOMRefCell<WebVRFrameData>,
#[ignore_heap_size_of = "Defined in rust-webvr"]
layer: DOMRefCell<WebVRLayer>,
layer_ctx: MutNullableHeap<JS<WebGLRenderingContext>>,
next_raf_id: Cell<u32>,
/// List of request animation frame callbacks
#[ignore_heap_size_of = "closures are hard"]
raf_callback_list: DOMRefCell<Vec<(u32, Option<Box<FnBox(f64)>>)>>,
// Compositor VRFrameData synchonization
frame_data_status: Cell<VRFrameDataStatus>,
#[ignore_heap_size_of = "channels are hard"]
frame_data_receiver: DOMRefCell<Option<IpcReceiver<Result<Vec<u8>,()>>>>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment