Skip to content
Permalink
Browse files

Register a glwindow test XR device

  • Loading branch information...
asajeffrey committed Jul 5, 2019
1 parent 39ec04a commit 8e535857c22aec8b31f1284857d63674aad7caa6
Showing with 21 additions and 3 deletions.
  1. +3 −2 Cargo.lock
  2. +2 −1 ports/glutin/Cargo.toml
  3. +16 −0 ports/glutin/embedder.rs

Some generated files are not rendered by default. Learn more.

@@ -59,7 +59,8 @@ log = "0.4"
rust-webvr = { version = "0.13", features = ["glwindow"] }
servo-media = {git = "https://github.com/servo/media"}
tinyfiledialogs = "3.0"
webxr = { git = "https://github.com/servo/webxr", features = ["glwindow"] }
webxr-api = { git = "https://github.com/servo/webxr", features = ["ipc"] }
webxr = { git = "https://github.com/servo/webxr", features = ["ipc", "glwindow"] }

[target.'cfg(any(target_os = "linux", target_os = "windows"))'.dependencies]
image = "0.21"
@@ -71,4 +71,20 @@ impl EmbedderMethods for EmbedderCallbacks {
// FIXME: support headless mode
}
}

fn register_webxr(&mut self, xr: &mut webxr_api::MainThreadRegistry) {
if !opts::get().headless {
if pref!(dom.webxr.test) {
warn!("Creating test XR device");
let gl = self.gl.clone();
let events_loop_clone = self.events_loop.clone();
let events_loop_factory = Box::new(move || {
events_loop_clone.borrow_mut().take().ok_or(EventsLoopClosed)
});
let gl_version = app::gl_version();
let discovery = webxr::glwindow::GlWindowDiscovery::new(gl, events_loop_factory, gl_version);
xr.register(discovery);
}
}
}
}

0 comments on commit 8e53585

Please sign in to comment.
You can’t perform that action at this time.