mirror of
https://github.com/mii443/rust-openvr.git
synced 2025-08-22 16:25:36 +00:00
fixed oculus info
This commit is contained in:
3
configure
vendored
3
configure
vendored
@ -173,7 +173,8 @@ modules = [Bin("oculus-info", ["oculus-vr"]),
|
||||
Lib("oculus-vr", ["cgmath", "libovr_wrapper.a"]),
|
||||
LibMakefile("libovr_wrapper.a", "src/oculus-vr/", "src/oculus-vr/libovr_wrapper.a", ["libovr.a"]),
|
||||
LibMakefile("libovr.a", "thirdparty/OculusSDK/", "thirdparty/OculusSDK/LibOVR/Lib/Linux/Release/x86_64/libovr.a"),
|
||||
Lib("steamworks-vr", ["cgmath"]),
|
||||
Lib("steamworks-vr", ["cgmath", "libsteamvr_wrapper.a"]),
|
||||
LibMakefile("libsteamvr_wrapper.a", "src/steamworks-vr/", "src/steamworks-vr/libsteamvr_wrapper.a"),
|
||||
Lib("cgmath")]
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
#[crate_id = "oculus-info#0.1"];
|
||||
|
||||
extern crate ovr = "oculus-vr";
|
||||
|
||||
|
@ -1,33 +0,0 @@
|
||||
|
||||
|
||||
extern mod ovr = "ovr-rs";
|
||||
|
||||
fn main()
|
||||
{
|
||||
ovr::init();
|
||||
|
||||
let dm = ovr::DeviceManager::new().unwrap();
|
||||
let dev = dm.enumerate().unwrap();
|
||||
let info = dev.get_info().unwrap();
|
||||
|
||||
let sf = ovr::SensorFusion::new().unwrap();
|
||||
let sensor = dev.get_sensor().unwrap();
|
||||
|
||||
sf.attach_to_sensor(&sensor);
|
||||
|
||||
match info.resolution() {
|
||||
(w, h) => println!("Resolution: {}x{}", w, h)
|
||||
};
|
||||
match info.size() {
|
||||
(w, h) => println!("Size: {}x{}", w, h)
|
||||
};
|
||||
|
||||
println!("Vertical Center: {}", info.vertical_center());
|
||||
println!("Eye to screen distance: {}", info.eye_to_screen_distance());
|
||||
println!("Lens separation distance: {}", info.lens_separation_distance());
|
||||
println!("Interpupillary distance: {}", info.interpupillary_distance());
|
||||
println!("distortion K: {:?}", info.distortion_K());
|
||||
println!("Chroma Ab Correction: {:?}", info.chroma_ab_correction());
|
||||
println!("display name: {:s}", info.name());
|
||||
println!("display id: {:?}", info.id());
|
||||
}
|
@ -209,7 +209,6 @@ impl HMDDevice {
|
||||
pub fn get_info(&self) -> HMDInfo
|
||||
{
|
||||
unsafe {
|
||||
println!("{:?}", self);
|
||||
HMDInfo{
|
||||
dat: ll::OVR_HMDDevice_GetDeviceInfo(self.ptr)
|
||||
}
|
||||
@ -219,7 +218,6 @@ impl HMDDevice {
|
||||
pub fn get_sensor(&self) -> Option<SensorDevice>
|
||||
{
|
||||
unsafe {
|
||||
println!("{:?}", self);
|
||||
let ptr = ll::OVR_HMDDevice_GetSensor(self.ptr);
|
||||
|
||||
if ptr.is_null() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
LIBSTEAMVR_INCLUDE_PATH=../thirdparty/Steamworks/public/steam/
|
||||
LIBSTEAMVR_LIB_PATH=../thirdparty/Steamworks/redistributable_bin/linux64/
|
||||
LIBSTEAMVR_INCLUDE_PATH=../../thirdparty/steamworks-vr-api/public/headers/
|
||||
LIBSTEAMVR_LIB_PATH=../../thirdparty/steamworks-vr-api/redistributable_bin/linux64/
|
||||
|
||||
all: libsteamvr_wrapper.a
|
||||
|
||||
@ -8,4 +8,4 @@ libsteamvr_wrapper.a: wrapper.o
|
||||
ar rcs libsteamvr_wrapper.a wrapper.o
|
||||
|
||||
wrapper.o: wrapper.cpp
|
||||
g++ -fPIC -I $(LIBSTEAMVR_INCLUDE_PATH) -DGNUC -DSTEAMWORKS -c -o wrapper.o wrapper.cpp
|
||||
g++ -fPIC -I $(LIBSTEAMVR_INCLUDE_PATH) -DGNUC -c -o wrapper.o wrapper.cpp
|
Reference in New Issue
Block a user