From 9d913bd2ca292874c211bd901e7ac4e0784a5c18 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 27 Oct 2021 20:10:29 +0300 Subject: feat: use ncurses for display --- src/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') 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(); } -- cgit v1.2.3