mirror of
https://github.com/servo/servo.git
synced 2025-07-13 02:13:40 +01:00
Allow the embedder to register their own VRServices
This commit is contained in:
parent
c80c3f3167
commit
a062c40567
9 changed files with 48 additions and 45 deletions
|
@ -18,6 +18,7 @@ use servo::script_traits::{MouseButton, TouchEventType, TouchId};
|
|||
use servo::servo_config::opts;
|
||||
use servo::servo_config::prefs::{PrefValue, PREFS};
|
||||
use servo::servo_url::ServoUrl;
|
||||
use servo::webvr::{VRExternalShmemPtr, VRServiceManager};
|
||||
use servo::{self, gl, webrender_api, BrowserId, Servo};
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::mem;
|
||||
|
@ -535,8 +536,10 @@ impl WindowMethods for ServoCallbacks {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_vrexternal_pointer(&self) -> Option<*mut c_void> {
|
||||
self.vr_pointer.clone()
|
||||
fn register_vr_services(&self, services: &mut VRServiceManager) {
|
||||
if let Some(ptr) = self.vr_pointer {
|
||||
services.register_vrexternal(VRExternalShmemPtr::new(ptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue