aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/fullscreen.rs4
-rw-r--r--examples/multiwindow.rs5
-rw-r--r--examples/support/mod.rs2
-rw-r--r--examples/window.rs4
4 files changed, 15 insertions, 0 deletions
diff --git a/examples/fullscreen.rs b/examples/fullscreen.rs
index cbe0303..011a7d3 100644
--- a/examples/fullscreen.rs
+++ b/examples/fullscreen.rs
@@ -14,6 +14,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 main() {
// enumerating monitors
let monitor = {
diff --git a/examples/multiwindow.rs b/examples/multiwindow.rs
index ad50312..ab48b6b 100644
--- a/examples/multiwindow.rs
+++ b/examples/multiwindow.rs
@@ -12,6 +12,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 main() {
let window1 = glutin::Window::new().unwrap();
let window2 = glutin::Window::new().unwrap();
@@ -30,6 +34,7 @@ fn main() {
});
}
+#[cfg(feature = "window")]
fn run(window: glutin::Window, color: (f32, f32, f32, f32)) {
unsafe { window.make_current() };
diff --git a/examples/support/mod.rs b/examples/support/mod.rs
index 154b01e..f27c4e7 100644
--- a/examples/support/mod.rs
+++ b/examples/support/mod.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "window")]
+
#[phase(plugin)]
extern crate gl_generator;
diff --git a/examples/window.rs b/examples/window.rs
index b2ad82e..769712a 100644
--- a/examples/window.rs
+++ b/examples/window.rs
@@ -12,6 +12,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 main() {
let window = glutin::Window::new().unwrap();