dragon/view demos: don't disturb menu bar

pull/723/head
nick black 4 years ago
parent cfe764bd57
commit d7b04217f9
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -49,19 +49,19 @@ int dragon_demo(struct notcurses* nc){
done = false;
int dimy, dimx;
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);
--dimy; // don't disturb the menu bar
// we use a Lindenmayer string rewriting system. the classic dragon curve
// system is X -> X+YF+, Y -> -FX-Y, where F is forward, - is turn left, and
// + is turn right.
const char LINDENSTART[] = "FX";
const int SCALE = 1;
dimy *= 2;
dimx *= 2;
int dxstart, dystart;
if(dimy > dimx){
dystart = 0;
dxstart = SCALE;
dxstart = 1;
}else{
dystart = SCALE;
dystart = 1;
dxstart = 0;
}
size_t fbbytes = sizeof(uint32_t) * dimy * dimx;
@ -101,6 +101,7 @@ int dragon_demo(struct notcurses* nc){
struct ncvisual_options vopts = {
.n = n,
.blitter = NCBLIT_2x2,
.y = 1,
};
if(ncvisual_render(nc, ncv, &vopts) == NULL){
ncvisual_destroy(ncv);
@ -108,6 +109,7 @@ int dragon_demo(struct notcurses* nc){
}
DEMO_RENDER(nc);
demo_nanosleep(nc, &scaled);
ncplane_erase(n);
}while(lasttotal != r);
ncvisual_destroy(ncv);
return 0;

@ -16,6 +16,7 @@ view_video_demo(struct notcurses* nc){
.scaling = NCSCALE_STRETCH,
.n = ncp,
.blitter = NCBLIT_2x2,
.y = 1,
};
int ret = ncvisual_stream(nc, ncv, &err, 2.0/3.0 * delaymultiplier,
demo_simple_streamer, &vopts, NULL);
@ -81,6 +82,7 @@ view_images(struct notcurses* nc, struct ncplane* nstd, int dimy, int dimx){
.n = dsplane,
.scaling = NCSCALE_STRETCH,
.blitter = NCBLIT_2x2,
.y = 1,
};
if(ncvisual_render(nc, ncv2, &vopts) == NULL){
ncvisual_destroy(ncv2);

Loading…
Cancel
Save