From 9bbfd96dd7cbfadd5b5147e53b87585af067dd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?joseLu=C3=ADs?= Date: Mon, 7 Jun 2021 20:59:35 +0200 Subject: [PATCH] [rust] delete examples for issues #1559 #1699 --- rust/examples/issue-1559.rs | 38 ------------------------------------- rust/examples/issue-1699.rs | 37 ------------------------------------ 2 files changed, 75 deletions(-) delete mode 100644 rust/examples/issue-1559.rs delete mode 100644 rust/examples/issue-1699.rs diff --git a/rust/examples/issue-1559.rs b/rust/examples/issue-1559.rs deleted file mode 100644 index f12a8c0eb..000000000 --- a/rust/examples/issue-1559.rs +++ /dev/null @@ -1,38 +0,0 @@ -//! https://github.com/dankamongmen/notcurses/issues/1559 - -use libnotcurses_sys::*; - -const WIDTH: u32 = 10; -const HEIGHT: u32 = 10; - -fn main() -> NcResult<()> { - let mut nc = Notcurses::new()?; - - if !nc.check_pixel_support()? { - return Err(NcError::new_msg("Current terminal doesn't support pixels.")); - } - - let mut buffer = Vec::::with_capacity((HEIGHT * WIDTH * 4) as usize); - #[allow(unused_parens)] - for _byte in (0..={ HEIGHT * WIDTH }) { - buffer.push(230); - buffer.push(30); - buffer.push(40); - buffer.push(255); - } - - let vframe = NcVisual::from_rgba(buffer.as_slice(), HEIGHT, WIDTH * 4, WIDTH)?; - let voptions = - NcVisualOptions::without_plane(0, 0, 0, 0, 0, 0, NCBLIT_PIXEL, 0, 0); - - // vframe.inflate(1)?; // this works - - vframe.resize(6, 1)?; - - vframe.render(&mut nc, &voptions)?; - - rsleep![&mut nc, 2]; - vframe.destroy(); - nc.stop()?; - Ok(()) -} diff --git a/rust/examples/issue-1699.rs b/rust/examples/issue-1699.rs deleted file mode 100644 index 526894e5c..000000000 --- a/rust/examples/issue-1699.rs +++ /dev/null @@ -1,37 +0,0 @@ -// https://github.com/dankamongmen/notcurses/issues/1699 -// https://github.com/dankamongmen/notcurses/issues/1700 - -use libnotcurses_sys::*; - -const W: u32 = 32; -const H: u32 = 32; - -fn main() -> NcResult<()> { - let nc = Notcurses::new()?; - - println!("pixel support: {:?}", nc.check_pixel_support()); - - // create a purple rectangle - let mut buffer = Vec::::with_capacity(H as usize * W as usize * 4); - #[allow(unused_parens)] - for _byte in (0..={ H * W }) { - buffer.push(190); - buffer.push(20); - buffer.push(80); - buffer.push(255); - } - - let vframe1 = NcVisual::from_bgra(&buffer, H, W * 4, W)?; - // let vframe1 = NcVisual::from_rgba(&buffer, H, W * 4, W)?; - - // let voptions = NcVisualOptions::without_plane(0, 0, 0, 0, H, W, NCBLIT_1x1, 0, 0); - let voptions = NcVisualOptions::without_plane(0, 0, 0, 0, H, W, NCBLIT_PIXEL, 0, 0); - - vframe1.render(nc, &voptions)?; - - nc.render()?; - sleep![2]; - vframe1.destroy(); - nc.stop()?; - Ok(()) -}