From 804f86a878fb884a10d7a6b04b2d70d093a5e03b Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Sun, 18 Sep 2016 10:18:11 +0200 Subject: [PATCH 1/5] Use docs on docs.rs Also correct link to changelog --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78ddd97..46ad66d 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ [![Crates.io](https://img.shields.io/crates/v/minifb.svg)](https://crates.io/crates/minifb) [![Build Status](https://travis-ci.org/emoon/rust_minifb.svg)](https://travis-ci.org/emoon/rust_minifb) [![Build Status](https://ci.appveyor.com/api/projects/status/sfvgqq4d4sjulkbx?svg=true)](https://ci.appveyor.com/project/emoon/rust-minifb) +[![Documentation](https://docs.rs/minifb/badge.svg)](https://docs.rs/minifb) minifb is a cross platform library written in [Rust](https://www.rust-lang.org) and that makes it easy to setup a window and to (optional) display a 32-bit pixel buffer. It also makes it easy to get input from keyboard and mouse. An example is the best way to show how it works: -[Documentation](http://prodbg.com/minifb/minifb/index.html) -[Changelog](https://github.com/emoon/rust_minifb/blob/window-opts/CHANGELOG.md) +[Changelog](https://github.com/emoon/rust_minifb/blob/master/CHANGELOG.md) Usage ----- From 219065a8c453322fd89dd34f04ceeb99132819c7 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Sun, 18 Sep 2016 10:25:08 +0200 Subject: [PATCH 2/5] Make example code a bit smaller --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 46ad66d..efacc23 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,12 @@ const HEIGHT: usize = 360; fn main() { let mut buffer: Vec = vec![0; WIDTH * HEIGHT]; - let mut window = match minifb::Window::new("Test - ESC to exit", WIDTH, HEIGHT, - WindowOptions::default()) { - Ok(win) => win, - Err(err) => { - println!("Unable to create window {}", err); - return; - } - }; + let mut window = Window::new("Test - ESC to exit", + WIDTH, + HEIGHT, + WindowOptions::default()).unwrap_or_else(|e| { + panic!("{}", e); + }); while window.is_open() && !window.is_key_down(Key::Escape) { for i in buffer.iter_mut() { From 8cca773a68f588fbfdfcdb7448d07b72678f8782 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Sun, 20 Nov 2016 07:37:49 +0100 Subject: [PATCH 3/5] Fixed example code Closes #31 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efacc23..d3b7881 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Example ```rust extern crate minifb; -use minifb::{Key, Scale, WindowOptions}; +use minifb::{Key, WindowOptions, Window}; const WIDTH: usize = 640; const HEIGHT: usize = 360; From a8e5215f554dc41eafdec36770de4d3fe5797345 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Fri, 6 Jan 2017 15:33:47 +0100 Subject: [PATCH 4/5] Fixed incorrect title Closes #32 --- examples/menu.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/menu.rs b/examples/menu.rs index a09b6f0..4a2c2a6 100644 --- a/examples/menu.rs +++ b/examples/menu.rs @@ -24,7 +24,7 @@ impl InputCallback for KeyCharCallback { fn main() { let mut buffer: Vec = vec![0; WIDTH * HEIGHT]; - let mut window = Window::new("Noise Test - Press ESC to exit", + let mut window = Window::new("Menu Test - Press ESC to exit", WIDTH, HEIGHT, WindowOptions { From 933d7662fb3f1e2e13e4ffac87a2337d83492344 Mon Sep 17 00:00:00 2001 From: FlyingGaz Date: Sun, 15 Jan 2017 17:46:02 +0100 Subject: [PATCH 5/5] Use to_vec in windows/update_with_buffer (#33) --- src/os/windows/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/windows/mod.rs b/src/os/windows/mod.rs index 2cb3bdf..8661d06 100644 --- a/src/os/windows/mod.rs +++ b/src/os/windows/mod.rs @@ -639,7 +639,7 @@ impl Window { Self::generic_update(self, window); - self.buffer = buffer.iter().cloned().collect(); + self.buffer = buffer.to_vec(); unsafe { user32::InvalidateRect(window, ptr::null_mut(), winapi::TRUE); }