diff --git a/Cargo.toml b/Cargo.toml index 05537dd..dd1ccfb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "piston_window" -version = "0.1.0" +version = "0.2.0" authors = ["bvssvni "] keywords = ["window", "piston"] description = "The official Piston window back-end for the Piston game engine" diff --git a/src/lib.rs b/src/lib.rs index fd5bcfe..daee459 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,11 +32,6 @@ type Glyphs = gfx_graphics::GlyphCache = GfxGraphics<'a, gfx_device_gl::Resources, gfx_device_gl::CommandBuffer, gfx_device_gl::Output>; -/// Creates a window using default window back-end. -pub fn window(settings: WindowSettings) -> Rc> { - Rc::new(RefCell::new(GlutinWindow::new(settings))) -} - /// Contains everything required for controlling window, graphics, event loop. pub struct PistonWindow { /// The window. @@ -57,9 +52,12 @@ pub struct PistonWindow { pub factory: Rc>, } -impl From for PistonWindow { - fn from(settings: WindowSettings) -> PistonWindow { - PistonWindow::new(window(settings), empty_app()) +impl From for PistonWindow + where T: Window + OpenGLWindow + From, + T::Event: GenericEvent +{ + fn from(settings: WindowSettings) -> PistonWindow { + PistonWindow::new(Rc::new(RefCell::new(settings.into())), empty_app()) } }