mirror of
https://github.com/mii443/rust-openvr.git
synced 2025-08-22 16:25:36 +00:00
Merge branch 'master' of github.com:csherratt/ovr-rs
Conflicts: info.rs ovr/test.rs test.rs
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
extern crate ovr = "ovr-rs";
|
||||
extern mod ovr = "ovr-rs";
|
||||
|
||||
fn main()
|
||||
{
|
||||
@ -30,4 +30,4 @@ fn main()
|
||||
println!("Chroma Ab Correction: {:?}", info.chroma_ab_correction());
|
||||
println!("display name: {:s}", info.name());
|
||||
println!("display id: {:?}", info.id());
|
||||
}
|
||||
}
|
14
ovr/lib.rs
14
ovr/lib.rs
@ -2,7 +2,7 @@
|
||||
#[crate_type = "lib"];
|
||||
#[feature(link_args)];
|
||||
|
||||
extern mod cgmath;
|
||||
extern crate cgmath;
|
||||
|
||||
use std::libc::{c_float, time_t, c_void};
|
||||
use std::c_str::ToCStr;
|
||||
@ -24,6 +24,12 @@ use cgmath::angle::rad;
|
||||
#[link(name="edid")]
|
||||
extern {}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[link(name="ovr_wrapper")]
|
||||
#[link(name="OculusVR")]
|
||||
#[link(name="stdc++")]
|
||||
extern {}
|
||||
|
||||
pub mod ll {
|
||||
use std::libc::{c_uint, c_int, c_float, c_long, c_char, time_t, c_void};
|
||||
|
||||
@ -724,14 +730,14 @@ void main()
|
||||
}
|
||||
|
||||
|
||||
float blue = texture2D(Texture0, tcBlue).b;
|
||||
float blue = texture(Texture0, tcBlue).b;
|
||||
|
||||
vec2 tcGreen = LensCenter + ScaleOut * theta1;
|
||||
vec4 center = texture2D(Texture0, tcGreen);
|
||||
vec4 center = texture(Texture0, tcGreen);
|
||||
|
||||
vec2 thetaRed = theta1 * (ChromAbParam.x + ChromAbParam.y * rSq);
|
||||
vec2 tcRed = LensCenter + ScaleOut * thetaRed;
|
||||
float red = texture2D(Texture0, tcRed).r;
|
||||
float red = texture(Texture0, tcRed).r;
|
||||
|
||||
color = vec4(red, center.g, blue, center.a);
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ extern "C"
|
||||
};
|
||||
|
||||
struct HMDInfoC {
|
||||
uint HResolution;
|
||||
uint VResolution;
|
||||
unsigned int HResolution;
|
||||
unsigned int VResolution;
|
||||
float HScreenSize;
|
||||
float VScreenSize;
|
||||
float VScreenCenter;
|
||||
|
Reference in New Issue
Block a user