all PoCs: ncvisual_render -> ncvisual_blit #1462

pull/2280/head
nick black 3 years ago committed by nick black
parent 2c8286c099
commit 0afd815925

@ -13,7 +13,7 @@ static int
wipebitmap(struct notcurses* nc){
int cellpxy, cellpxx;
ncplane_pixelgeom(notcurses_stdplane(nc), NULL, NULL,
&cellpxy, &cellpxx, NULL, NULL);
&cellpxy, &cellpxx, NULL, NULL);
int pixy = cellpxy * 6;
int pixx = cellpxx * 6;
uint32_t pixels[pixx * pixy];
@ -27,8 +27,10 @@ wipebitmap(struct notcurses* nc){
}
struct ncvisual_options vopts = {
.blitter = NCBLIT_PIXEL,
.n = notcurses_stdplane(nc),
.flags = NCVISUAL_OPTION_CHILDPLANE,
};
struct ncplane* n = ncvisual_render(nc, ncv, &vopts);
struct ncplane* n = ncvisual_blit(nc, ncv, &vopts);
if(n == NULL){
return -1;
}
@ -84,7 +86,7 @@ wipebitmap(struct notcurses* nc){
if(ncve == NULL){
return -1;
}
if((n = ncvisual_render(nc, ncve, &vopts)) == NULL){
if((n = ncvisual_blit(nc, ncve, &vopts)) == NULL){
return -1;
}
emit(notcurses_stdplane(nc), "Ought see empty square");
@ -96,7 +98,7 @@ wipebitmap(struct notcurses* nc){
// now, actually wipe the middle with *s, and then ensure that a new render
// gets wiped out before being displayed
if(ncvisual_render(nc, ncv, &vopts) == NULL){
if(ncvisual_blit(nc, ncv, &vopts) == NULL){
return -1;
}
emit(notcurses_stdplane(nc), "Ought see full square");
@ -114,7 +116,7 @@ wipebitmap(struct notcurses* nc){
notcurses_render(nc);
sleep(2);
if(ncvisual_render(nc, ncv, &vopts) == NULL){
if(ncvisual_blit(nc, ncv, &vopts) == NULL){
return -1;
}
emit(notcurses_stdplane(nc), "Ought *still* see 16 *s");

@ -45,9 +45,11 @@ int main(int argc, char** argv){
struct ncvisual_options vopts = {
.scaling = scaling,
.blitter = *blitter,
.n = notcurses_stdplane(nc),
.flags = NCVISUAL_OPTION_CHILDPLANE,
};
struct ncplane* cn;
if((cn = ncvisual_render(nc, ncv, &vopts)) == NULL){
if((cn = ncvisual_blit(nc, ncv, &vopts)) == NULL){
ncvisual_destroy(ncv);
goto err;
}

@ -90,7 +90,7 @@ int main(void){
.scaling = NCSCALE_STRETCH,
.n = n,
};
if(ncvisual_render(nc, ncv, &vopts) == NULL){
if(ncvisual_blit(nc, ncv, &vopts) == NULL){
goto err;
}
ncvisual_destroy(ncv);

@ -41,10 +41,11 @@ handle(struct notcurses* nc, const char* fn){
}
// render by itself
struct ncvisual_options vopts = {
.n = notcurses_stdplane(nc),
.blitter = NCBLIT_PIXEL,
.flags = NCVISUAL_OPTION_NODEGRADE,
.flags = NCVISUAL_OPTION_NODEGRADE | NCVISUAL_OPTION_CHILDPLANE,
};
struct ncplane* n = ncvisual_render(nc, ncv, &vopts);
struct ncplane* n = ncvisual_blit(nc, ncv, &vopts);
if(n == NULL){
ncvisual_destroy(ncv);
return -1;

@ -30,6 +30,7 @@ int main(int argc, char** argv){
if(!ncv){
goto err;
}
vopts.n = notcurses_stdplane(nc);
vopts.scaling = NCSCALE_STRETCH;
vopts.flags = NCVISUAL_OPTION_CHILDPLANE;
struct ncplane* ntarg;

Loading…
Cancel
Save