mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
[rust] update example pixel-cell & remove poc-planebase
This commit is contained in:
parent
2f59fc7282
commit
6ab072c953
@ -24,7 +24,9 @@ fn main() -> NcResult<()> {
|
||||
let voptions =
|
||||
NcVisualOptions::without_plane(0, 0, 0, 0, HEIGHT, WIDTH, NCBLIT_PIXEL, 0, 0);
|
||||
|
||||
vframe.resize(1, 1)?; // it doesn't matter which values we put here
|
||||
// vframe.inflate(1)?; // this works
|
||||
|
||||
vframe.resize(1, 1)?; // but it doesn't matter which values we put here
|
||||
|
||||
// FIXME: render always gives an error
|
||||
vframe.render(&mut nc, &voptions)?;
|
||||
|
@ -1,29 +0,0 @@
|
||||
use libnotcurses_sys::*;
|
||||
|
||||
fn main() -> NcResult<()> {
|
||||
let mut nc = Nc::with_debug(NCLOGLEVEL_INFO, 0)?;
|
||||
|
||||
let (dimy, dimx) = nc.term_dim_yx();
|
||||
let stdn = nc.stdplane();
|
||||
|
||||
let p1 = NcPlane::new_bound(stdn, 0, 0, dimy, dimx)?;
|
||||
|
||||
let mut channels = NcChannelPair::with_rgb8(0, 0xcc, 0, 0, 0x88, 0);
|
||||
p1.set_base(" ", 0, channels)?;
|
||||
|
||||
let p2 = NcPlane::new_bound(stdn, 0, 0, dimy / 3, dimx / 3)?;
|
||||
p2.set_base(" ", 0, channels.set_bg_rgb8(0x88, 0, 0))?;
|
||||
|
||||
let p3 = NcPlane::new_bound(stdn, 0, 0, dimy / 9, dimx / 9)?;
|
||||
p3.set_base(" ", 0, channels.set_bg_rgb8(0, 0, 0x88))?;
|
||||
|
||||
rsleep![&mut nc, 1];
|
||||
|
||||
p3.move_yx((dimy - dimy / 9) as i32, (dimx - dimx / 9) as i32)?;
|
||||
rsleep![&mut nc, 1];
|
||||
|
||||
p2.move_yx((dimy / 2) as i32, (dimx / 2) as i32)?;
|
||||
rsleep![&mut nc, 1];
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user