From 2b35a6c9d1a1e2f748b887947b16ce67d05207c2 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Sun, 4 Oct 2015 18:39:17 +0200 Subject: Fix the examples --- examples/cursor.rs | 7 +------ examples/fullscreen.rs | 4 ---- examples/grabbing.rs | 4 ---- examples/multiwindow.rs | 5 ----- examples/support/mod.rs | 2 -- examples/transparent.rs | 5 ----- examples/window.rs | 5 ----- 7 files changed, 1 insertion(+), 31 deletions(-) diff --git a/examples/cursor.rs b/examples/cursor.rs index b0ec16a..cbe6978 100644 --- a/examples/cursor.rs +++ b/examples/cursor.rs @@ -11,12 +11,7 @@ mod support; #[cfg(target_os = "android")] android_start!(main); -#[cfg(not(feature = "window"))] -fn main() { println!("This example requires glutin to be compiled with the `window` feature"); } - -#[cfg(feature = "window")] -fn main() { - +fn main() { let window = glutin::WindowBuilder::new().build().unwrap(); window.set_title("A fantastic window!"); unsafe { window.make_current() }; diff --git a/examples/fullscreen.rs b/examples/fullscreen.rs index 305829d..977e084 100644 --- a/examples/fullscreen.rs +++ b/examples/fullscreen.rs @@ -11,10 +11,6 @@ mod support; #[cfg(target_os = "android")] android_start!(main); -#[cfg(not(feature = "window"))] -fn main() { println!("This example requires glutin to be compiled with the `window` feature"); } - -#[cfg(feature = "window")] fn main() { // enumerating monitors let monitor = { diff --git a/examples/grabbing.rs b/examples/grabbing.rs index f6cef73..4b12b02 100644 --- a/examples/grabbing.rs +++ b/examples/grabbing.rs @@ -11,10 +11,6 @@ mod support; #[cfg(target_os = "android")] android_start!(main); -#[cfg(not(feature = "window"))] -fn main() { println!("This example requires glutin to be compiled with the `window` feature"); } - -#[cfg(feature = "window")] fn main() { let window = glutin::WindowBuilder::new().build().unwrap(); window.set_title("glutin - Cursor grabbing test"); diff --git a/examples/multiwindow.rs b/examples/multiwindow.rs index acb2e99..f6154ce 100644 --- a/examples/multiwindow.rs +++ b/examples/multiwindow.rs @@ -11,10 +11,6 @@ mod support; #[cfg(target_os = "android")] android_start!(main); -#[cfg(not(feature = "window"))] -fn main() { println!("This example requires glutin to be compiled with the `window` feature"); } - -#[cfg(feature = "window")] fn main() { let window1 = glutin::WindowBuilder::new().build().unwrap(); let window2 = glutin::WindowBuilder::new().build().unwrap(); @@ -37,7 +33,6 @@ fn main() { let _ = t3.join(); } -#[cfg(feature = "window")] fn run(window: glutin::Window, color: (f32, f32, f32, f32)) { let _ = unsafe { window.make_current() }; diff --git a/examples/support/mod.rs b/examples/support/mod.rs index f05e425..6d5a931 100644 --- a/examples/support/mod.rs +++ b/examples/support/mod.rs @@ -1,5 +1,3 @@ -#![cfg(feature = "window")] - use std::ffi::CStr; use std::mem; use std::ptr; diff --git a/examples/transparent.rs b/examples/transparent.rs index 9392d38..84795d5 100644 --- a/examples/transparent.rs +++ b/examples/transparent.rs @@ -9,15 +9,10 @@ mod support; #[cfg(target_os = "android")] android_start!(main); -#[cfg(not(feature = "window"))] -fn main() { println!("This example requires glutin to be compiled with the `window` feature"); } - -#[cfg(feature = "window")] fn resize_callback(width: u32, height: u32) { println!("Window resized to {}x{}", width, height); } -#[cfg(feature = "window")] fn main() { let mut window = glutin::WindowBuilder::new().with_decorations(false) .with_transparency(true) diff --git a/examples/window.rs b/examples/window.rs index 8f378f0..ddf98a9 100644 --- a/examples/window.rs +++ b/examples/window.rs @@ -9,15 +9,10 @@ mod support; #[cfg(target_os = "android")] android_start!(main); -#[cfg(not(feature = "window"))] -fn main() { println!("This example requires glutin to be compiled with the `window` feature"); } - -#[cfg(feature = "window")] fn resize_callback(width: u32, height: u32) { println!("Window resized to {}x{}", width, height); } -#[cfg(feature = "window")] fn main() { let mut window = glutin::WindowBuilder::new().build().unwrap(); window.set_title("A fantastic window!"); -- cgit v1.2.3