diff options
-rw-r--r-- | Cargo.toml | 19 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | src/win32/monitor.rs | 2 | ||||
-rw-r--r-- | src/x11/window/mod.rs | 2 | ||||
-rw-r--r-- | src/x11/window/monitor.rs | 4 |
5 files changed, 17 insertions, 13 deletions
@@ -5,22 +5,27 @@ version = "0.0.1" authors = ["tomaka <pierre.krieger1708@gmail.com>"] [features] -default = ["cocoa", "window"] +default = ["window"] window = [] headless = [] [dependencies.compile_msg] git = "https://github.com/huonw/compile_msg" -[dependencies.android_glue] -git = "https://github.com/tomaka/android-rs-glue" - [dependencies.gl_generator] git = "https://github.com/bjz/gl-rs" -[dependencies.cocoa] +[target.arm-linux-androideabi.dependencies.android_glue] +git = "https://github.com/tomaka/android-rs-glue" + +[target.i686-apple-darwin.dependencies.cocoa] git = "https://github.com/DavidPartouche/rust-cocoa" -optional = true -[dependencies.core_foundation] +[target.x86_64-apple-darwin.dependencies.cocoa] +git = "https://github.com/DavidPartouche/rust-cocoa" + +[target.i686-apple-darwin.dependencies.core_foundation] +git = "https://github.com/servo/rust-core-foundation" + +[target.x86_64-apple-darwin.dependencies.core_foundation] git = "https://github.com/servo/rust-core-foundation" @@ -10,8 +10,7 @@ Alternative to GLFW in pure Rust. ```bash git clone https://github.com/tomaka/glutin cd glutin -cargo test -./target/test/window # or target\test\window.exe +cargo run --example window ``` ## Usage diff --git a/src/win32/monitor.rs b/src/win32/monitor.rs index a45c8fb..3e6b79a 100644 --- a/src/win32/monitor.rs +++ b/src/win32/monitor.rs @@ -101,7 +101,7 @@ pub fn get_primary_monitor() -> MonitorID { } } - fail!("Failed to find the primary monitor") + panic!("Failed to find the primary monitor") } impl MonitorID { diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index 2f00438..26d5497 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -510,7 +510,7 @@ impl Window { pub unsafe fn make_current(&self) { let res = ffi::glx::MakeCurrent(self.display, self.window, self.context); if res == 0 { - fail!("glx::MakeCurrent failed"); + panic!("glx::MakeCurrent failed"); } } diff --git a/src/x11/window/monitor.rs b/src/x11/window/monitor.rs index 013b48b..f62a8ef 100644 --- a/src/x11/window/monitor.rs +++ b/src/x11/window/monitor.rs @@ -9,7 +9,7 @@ pub fn get_available_monitors() -> Vec<MonitorID> { let nb_monitors = unsafe { let display = ffi::XOpenDisplay(ptr::null()); if display.is_null() { - fail!("get_available_monitors failed"); + panic!("get_available_monitors failed"); } let nb_monitors = ffi::XScreenCount(display); ffi::XCloseDisplay(display); @@ -26,7 +26,7 @@ pub fn get_primary_monitor() -> MonitorID { let primary_monitor = unsafe { let display = ffi::XOpenDisplay(ptr::null()); if display.is_null() { - fail!("get_available_monitors failed"); + panic!("get_available_monitors failed"); } let primary_monitor = ffi::XDefaultScreen(display); ffi::XCloseDisplay(display); |