update piston-window

This commit is contained in:
Fabien Freling 2020-03-09 18:30:06 +01:00
parent 0738c7a15f
commit dd6a65d843
4 changed files with 891 additions and 721 deletions

1603
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -4,4 +4,4 @@ version = "0.1.0"
authors = ["Fabien Freling <public@ffreling.com>"]
[dependencies]
piston_window = "0.70.0"
piston_window = "0.107.0"

View file

@ -1,5 +1,4 @@
extern crate piston_window;
use piston_window::*;
use std::f64::consts;

View file

@ -1,5 +1,4 @@
extern crate piston_window;
use piston_window::*;
mod engine;
@ -13,7 +12,8 @@ fn main() {
WindowSettings::new("Rustenstein", [640, 480])
.exit_on_esc(true)
.resizable(false)
.build().unwrap();
.build()
.unwrap_or_else(|e| { panic!("Failed to build PistonWindow: {}", e) });
let level: [Tile; 5 * 5] = [
Tile::Wall, Tile::Wall, Tile::Wall, Tile::Wall, Tile::Wall,
@ -26,7 +26,7 @@ fn main() {
let mut engine = engine::Engine::new(window.size());
while let Some(event) = window.next() {
window.draw_2d(&event, |context, graphics| {
window.draw_2d(&event, |context, graphics, device| {
engine.render(context, graphics);
});
}