aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaka17 <pierre.krieger1708@gmail.com>2014-08-13 14:52:12 +0200
committerTomaka17 <pierre.krieger1708@gmail.com>2014-08-13 14:52:12 +0200
commit3aab801f291c513f5b662589097fa5d5653d8ffe (patch)
treea420486bdc79cb37478998c6be901332e9f2f21c
parentca83db39c71b81fa10901b1b066ad27686229187 (diff)
downloadglutin-3aab801f291c513f5b662589097fa5d5653d8ffe.tar.gz
glutin-3aab801f291c513f5b662589097fa5d5653d8ffe.zip
Implement Default for Window
-rw-r--r--src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d7cb97f..3cc3518 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,6 +23,8 @@ extern crate libc;
pub use events::*;
+use std::default::Default;
+
#[cfg(target_os = "win32")]
use winimpl = win32;
#[cfg(target_os = "linux")]
@@ -145,6 +147,12 @@ pub struct Window {
window: winimpl::Window,
}
+impl Default for Window {
+ fn default() -> Window {
+ Window::new().unwrap()
+ }
+}
+
impl Window {
/// Creates a new OpenGL context, and a Window for platforms where this is appropriate.
///