aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuomas Siipola2019-08-28 21:35:25 +0300
committerTuomas Siipola2019-08-28 21:35:25 +0300
commit54118389eb508245b1f7f555522edcc94363e061 (patch)
treeef4d375e69348237fe3198732cdd62f1b98e2a60
parenta17c505c729c193fd3563ef36815fa27be6fded8 (diff)
Render game in 2x scaleHEADmaster
-rw-r--r--src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 3497689..f4838ad 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -20,13 +20,17 @@ fn main() {
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
+ let scale = 2;
+
let window = video_subsystem
- .window("Natrix", 320, 240)
+ .window("Natrix", scale * 320, scale * 240)
.position_centered()
.build()
.unwrap();
let mut canvas = window.into_canvas().software().build().unwrap();
+ canvas.set_scale(scale as f32, scale as f32).unwrap();
+
let texture_creator = canvas.texture_creator();
let tiles = texture_creator