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

Commit

Permalink
Auto merge of #27 - Manishearth:gvr, r=asajeffrey
Browse files Browse the repository at this point in the history
GoogleVR support

Depends on #25

Not yet finished.
  • Loading branch information
bors-servo authored Jul 29, 2019
2 parents 96c964c + b00d879 commit fcbdddb
Show file tree
Hide file tree
Showing 21 changed files with 1,662 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
*~
target
Cargo.lock

.idea
.vscode
.gradle/
build/
*.iml
local.properties
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ before_script:
script:
- cargo fmt --all -- --check
- cd webxr
- cargo build --features=glwindow,headless
- cargo build --features=ipc,glwindow,headless
- cargo build --features=glwindow,headless,googlevr
- cargo build --features=ipc,glwindow,headless,googlevr
- rustup target add arm-linux-androideabi
- cargo build --target arm-linux-androideabi --features=ipc,googlevr

notifications:
webhooks: http://build.servo.org:54856/travis
1 change: 1 addition & 0 deletions webxr-api/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ use serde::{Deserialize, Serialize};
pub enum Error {
NoMatchingDevice,
CommunicationError,
BackendSpecific(String),
}
11 changes: 10 additions & 1 deletion webxr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@ path = "lib.rs"
glwindow = ["glutin"]
headless = []
ipc = ["webxr-api/ipc"]
googlevr = ["gvr-sys", "android_injected_glue"]


[dependencies]
webxr-api = { path = "../webxr-api" }
euclid = "0.20"
gleam = "0.6"
glutin = { version = "0.21", optional = true }
log = "0.4"
log = "0.4.6"
gvr-sys = { version = "0.7", optional = true }

[target.'cfg(target_os = "android")'.dependencies]
android_injected_glue = { version = "0.2.2", optional = true }

[build-dependencies]
gl_generator = "0.11"
28 changes: 28 additions & 0 deletions webxr/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use gl_generator::{Api, Fallbacks, Profile, Registry};
use std::env;
use std::fs::{self, File};
use std::path::Path;

fn main() {
// Copy AARs
if let Ok(aar_out_dir) = env::var("AAR_OUT_DIR") {
fs::copy(
&Path::new("googlevr/aar/GVRService.aar"),
&Path::new(&aar_out_dir).join("GVRService.aar"),
)
.unwrap();
}

if !cfg!(feature = "googlevr") {
return;
}

let out_dir = env::var("OUT_DIR").unwrap();

// GLES 2.0 bindings
let mut file = File::create(&Path::new(&out_dir).join("gles_bindings.rs")).unwrap();
let gles_reg = Registry::new(Api::Gles2, (3, 0), Profile::Core, Fallbacks::All, []);
gles_reg
.write_bindings(gl_generator::StaticGenerator, &mut file)
.unwrap();
}
Binary file added webxr/googlevr/aar/GVRService.aar
Binary file not shown.
Loading

0 comments on commit fcbdddb

Please sign in to comment.