From fd6d6cd53ec0726326514accd673baa607ff21ae Mon Sep 17 00:00:00 2001 From: Colin Sherratt Date: Sat, 22 Feb 2014 01:46:48 -0500 Subject: [PATCH 1/3] renamed mod to crate --- lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.rs b/lib.rs index defc59f..0ba2f6b 100644 --- a/lib.rs +++ b/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; From e77c553357f249ff20ed7a1d81dcd778e702321c Mon Sep 17 00:00:00 2001 From: Colin Sherratt Date: Sat, 22 Feb 2014 14:06:11 -0500 Subject: [PATCH 2/3] renamed test.rs --- test.rs => info.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test.rs => info.rs (100%) diff --git a/test.rs b/info.rs similarity index 100% rename from test.rs rename to info.rs From b8bafb83a868a7c3fc7283671b7c1e518c09455c Mon Sep 17 00:00:00 2001 From: Colin Sherratt Date: Sun, 2 Mar 2014 14:57:27 -0700 Subject: [PATCH 3/3] Fixed osx build --- lib.rs | 12 +++++++++--- wrapper.cpp | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib.rs b/lib.rs index 0ba2f6b..fd8234b 100644 --- a/lib.rs +++ b/lib.rs @@ -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); } diff --git a/wrapper.cpp b/wrapper.cpp index 5f9e0a6..327edbb 100644 --- a/wrapper.cpp +++ b/wrapper.cpp @@ -18,8 +18,8 @@ extern "C" }; struct HMDInfoC { - uint HResolution; - uint VResolution; + unsigned int HResolution; + unsigned int VResolution; float HScreenSize; float VScreenSize; float VScreenCenter;