Explicitly name window size constant
separating out and committing pieces in an old WIP. Don't know what specifically prompted this change.
This commit is contained in:
@@ -9,9 +9,10 @@ extern crate piston;
|
|||||||
extern crate piston_window;
|
extern crate piston_window;
|
||||||
|
|
||||||
use self::piston::input::{Button, ButtonArgs, Input, Key};
|
use self::piston::input::{Button, ButtonArgs, Input, Key};
|
||||||
use self::piston_window::{PistonWindow, Window, WindowSettings};
|
use self::piston_window::{PistonWindow, Size, Window, WindowSettings};
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
|
const WINDOW_SIZE: Size = Size { width: 1024, height: 1024 };
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
env_logger::init().expect("env logger");
|
env_logger::init().expect("env logger");
|
||||||
@@ -21,7 +22,7 @@ pub fn main() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut window: PistonWindow =
|
let mut window: PistonWindow =
|
||||||
WindowSettings::new("Hello, Britannia!", [1024; 2])
|
WindowSettings::new("Hello, Britannia!", WINDOW_SIZE)
|
||||||
.exit_on_esc(true)
|
.exit_on_esc(true)
|
||||||
.vsync(vr.is_none()) // Let VR throttle framerate, if available
|
.vsync(vr.is_none()) // Let VR throttle framerate, if available
|
||||||
.build().expect("Building Window");
|
.build().expect("Building Window");
|
||||||
|
|||||||
Reference in New Issue
Block a user