diff options
Diffstat (limited to 'flowy/src/main.rs')
-rw-r--r-- | flowy/src/main.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/flowy/src/main.rs b/flowy/src/main.rs index 6620ed8..8529f2c 100644 --- a/flowy/src/main.rs +++ b/flowy/src/main.rs @@ -5,7 +5,8 @@ use log::{debug, info}; use motion::{dec::MotionDecoder, enc::MotionEncoder, CommonBuffers, Params}; use pollster::FutureExt; use std::{ - io::{stdin, stdout, Read, Write}, + io::{stdin, stdout, ErrorKind, Read, Write}, + process::exit, time::Instant, }; use wgpu::{ @@ -86,9 +87,16 @@ fn main() { debug: fparams.debug == 2, preview: fparams.debug > 0, }; - eprintln!("{params:?} {rp:?}"); + debug!("{params:?} {rp:?}"); debug!("read"); - stdin().read_exact(&mut buffer).unwrap(); + match stdin().read_exact(&mut buffer) { + Ok(_) => (), + Err(e) if e.kind() == ErrorKind::UnexpectedEof => { + break; + } + Err(e) => Err(e).unwrap(), + } + framework.next_frame_manual(); debug!("upload"); @@ -120,4 +128,6 @@ fn main() { stdout().write_all(&buffer).unwrap(); i += 1; } + eprintln!("done"); + exit(0); } |