mirror of
https://github.com/mii443/rust-openvr.git
synced 2025-08-22 16:25:36 +00:00
moved sys to other repo, preparation for crates release
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "openvr"]
|
||||
path = openvr
|
||||
url = https://github.com/ValveSoftware/openvr.git
|
12
Cargo.toml
12
Cargo.toml
@ -6,14 +6,20 @@ authors = [
|
||||
"Erick Tryzelaar",
|
||||
"Rene Eichhorn"
|
||||
]
|
||||
build = "src/sys/build.rs"
|
||||
license-file = "LICENSE.md"
|
||||
|
||||
documentation = "http://rust-openvr.github.io/rust-openvr/openvr/index.html"
|
||||
homepage = "https://github.com/rust-openvr/rust-openvr"
|
||||
repository = "https://github.com/rust-openvr/rust-openvr"
|
||||
|
||||
description = "A safe binding for openvr."
|
||||
|
||||
[lib]
|
||||
name = "openvr"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies.openvr_sys]
|
||||
path = "src/sys/"
|
||||
[dependencies]
|
||||
openvr_sys = "0.1.1"
|
||||
|
||||
[dev_dependencies]
|
||||
glium = "0.14.0"
|
||||
|
21
Readme.md
21
Readme.md
@ -3,29 +3,20 @@ rust-openvr
|
||||
|
||||
[](https://travis-ci.org/rust-openvr/rust-openvr)
|
||||
|
||||
rust-openvr is a binding for openvr. It's still in progress. Tests are automatically ran by travis.
|
||||
Also my private jenkins is running these test on Ubuntu 14.04 as well, every successful build will be pushed to its branch (stable, nightly, beta). For good practice always use either stable, beta or nightly instead of master!
|
||||
rust-openvr is a binding for openvr.
|
||||
|
||||
## [Link to the documentation](http://auruss.github.io/rust-openvr/openvr/index.html)
|
||||
## Current sdk version: OpenVR SDK 0.9.19
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
rust-openvr is fully cargoized. to Compile
|
||||
|
||||
cargo build
|
||||
|
||||
To add as a dependency using cargo Cargo add the following to your `Cargo.toml`. Will be added to crates.io once we've a stable version. For nightly/beta use nightly/beta branch instead.
|
||||
|
||||
[dependencies.openvr]
|
||||
git = "https://github.com/auruss/rust-openvr.git"
|
||||
branch = "stable"
|
||||
|
||||
|
||||
Using rust-openvr
|
||||
-----------
|
||||
|
||||
# Requirements
|
||||
|
||||
When trying to start a program that uses rust-openvr you will probably get an error message because it can't find openvr.dll (or openvr.so)
|
||||
You can download the latest version here (https://github.com/ValveSoftware/openvr/tree/master/bin). After downloading please add it into your project folder (also for production releases!).
|
||||
|
||||
# Initializing
|
||||
|
||||
```rust
|
||||
|
21
examples/debug.rs
Normal file
21
examples/debug.rs
Normal file
@ -0,0 +1,21 @@
|
||||
extern crate openvr;
|
||||
extern crate nalgebra;
|
||||
|
||||
pub fn main () {
|
||||
let system = openvr::init().unwrap();
|
||||
let render_model = openvr::render_models().unwrap();
|
||||
let _ = openvr::compositor().unwrap();
|
||||
|
||||
loop {
|
||||
let _ = openvr::compositor().unwrap().wait_get_poses();
|
||||
let raw = system.projection_matrix(openvr::Eye::Left, 0.1, 1000.0);
|
||||
|
||||
let mat = nalgebra::Matrix4::new(
|
||||
raw[0][0], raw[0][1], raw[0][2], raw[0][3],
|
||||
raw[1][0], raw[1][1], raw[1][2], raw[1][3],
|
||||
raw[2][0], raw[2][1], raw[2][2], raw[2][3],
|
||||
raw[3][0], raw[3][1], raw[3][2], raw[3][3]);
|
||||
|
||||
println!("{:?}", mat);
|
||||
}
|
||||
}
|
1
openvr
1
openvr
Submodule openvr deleted from a6c91ef973
@ -1,5 +0,0 @@
|
||||
// This header is used for bindgen to automatically generate the openvr c binding
|
||||
// bindgen -match openvr_capi.h scripts/binding.h -o binding.rs
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "../openvr/headers/openvr_capi.h"
|
@ -1,13 +0,0 @@
|
||||
[package]
|
||||
name = "openvr_sys"
|
||||
version = "0.1.0"
|
||||
authors = [
|
||||
"Colin Sherratt",
|
||||
"Erick Tryzelaar"
|
||||
]
|
||||
|
||||
build = "build.rs"
|
||||
|
||||
[lib]
|
||||
name = "openvr_sys"
|
||||
path = "lib.rs"
|
@ -1,19 +0,0 @@
|
||||
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
fn main() {
|
||||
println!("cargo:rustc-link-search={}/../../openvr/lib/osx32", env!("CARGO_MANIFEST_DIR"));
|
||||
println!("cargo:rustc-link-search={}/../../openvr/bin/osx32", env!("CARGO_MANIFEST_DIR"));
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
fn main() {
|
||||
println!("cargo:rustc-link-search={}/../../openvr/lib/linux64", env!("CARGO_MANIFEST_DIR"));
|
||||
println!("cargo:rustc-link-search={}/../../openvr/bin/linux64", env!("CARGO_MANIFEST_DIR"));
|
||||
}
|
||||
|
||||
#[cfg(target_os="windows")]
|
||||
fn main() {
|
||||
println!("cargo:rustc-link-search={}\\..\\..\\openvr\\lib\\win64", env!("CARGO_MANIFEST_DIR"));
|
||||
println!("cargo:rustc-link-search={}\\..\\..\\openvr\\bin\\win64", env!("CARGO_MANIFEST_DIR"));
|
||||
}
|
2685
src/sys/lib.rs
2685
src/sys/lib.rs
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user