1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#[cfg(all(feature = "vrexternal", target_os= "android"))]
extern crate libc;
extern crate rust_webvr_api;
#[cfg(all(feature = "googlevr", target_os= "android"))]
extern crate gvr_sys;
#[cfg(all(target_os="windows", feature = "openvr"))]
extern crate libloading;
#[macro_use]
extern crate log;
#[cfg(all(feature = "oculusvr", target_os= "android"))]
extern crate ovr_mobile_sys;
#[cfg(feature = "glwindow")]
extern crate euclid;
#[cfg(feature = "glwindow")]
extern crate gleam;
#[cfg(feature = "glwindow")]
extern crate glutin;
#[cfg(feature = "glwindow")]
extern crate winit;
#[cfg(feature = "serde-serialization")]
#[macro_use] extern crate serde_derive;

#[cfg(any(feature = "googlevr", feature= "oculusvr"))]
mod gl {
    include!(concat!(env!("OUT_DIR"), "/gles_bindings.rs"));
}

#[cfg(feature= "oculusvr")]
mod egl {
    #![allow(non_camel_case_types, non_snake_case)]
    use std::os::raw::{c_long, c_void};
    pub type khronos_utime_nanoseconds_t = khronos_uint64_t;
    pub type khronos_uint64_t = u64;
    pub type khronos_ssize_t = c_long;
    pub type EGLint = i32;
    pub type EGLNativeDisplayType = *const c_void;
    pub type EGLNativePixmapType = *const c_void;
    pub type EGLNativeWindowType = *const c_void;
    pub type NativeDisplayType = EGLNativeDisplayType;
    pub type NativePixmapType = EGLNativePixmapType;
    pub type NativeWindowType = EGLNativeWindowType;
    include!(concat!(env!("OUT_DIR"), "/egl_bindings.rs"));
}

#[cfg(feature= "glwindow")]
pub use api::GlWindowVRService;

pub mod api;
mod vr_manager;

pub use rust_webvr_api::*;
pub use vr_manager::VRServiceManager;