diff options
author | eug-vs <eugene@eug-vs.xyz> | 2021-10-27 20:10:29 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2021-10-27 20:10:29 +0300 |
commit | 9d913bd2ca292874c211bd901e7ac4e0784a5c18 (patch) | |
tree | 60222f278c2f7a958db6fb007879030cba5820d3 | |
parent | d6dfb23733f4f767b459358a42dad55a85ffdce2 (diff) | |
download | pistol-9d913bd2ca292874c211bd901e7ac4e0784a5c18.tar.gz |
feat: use ncurses for display
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 243ee2d..9fec82d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,10 @@ +extern crate ncurses; + mod camera; mod canvas; use std::f32::consts::PI; use cgmath::Vector3; +use ncurses::*; use crate::camera::{Buffer, Camera, WIDTH, HEIGHT}; @@ -17,11 +20,18 @@ fn main() { time: 0.0, }; + initscr(); + for _round in 0..20 { for i in 0..60 { cam.time = (i as f32 / 60.0) * 2.0 * PI; cam.render(); - println!("{}", cam.buffer); + + clear(); + addstr(&cam.buffer.to_string()); + refresh(); } } + + endwin(); } |