mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-10-31 15:20:13 +00:00
vizdirect PoC: always call ncdirect_stop()
This commit is contained in:
parent
421f450526
commit
7f1d208a0a
@ -14,53 +14,57 @@ int main(void){
|
||||
}
|
||||
if(!ncdirect_canopen_images(n)){
|
||||
fprintf(stderr, "This notcurses was not build with multimedia support.\n");
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
ncdirect_set_fg_rgb8(n, 0xff, 0, 0xff);
|
||||
ncdirect_set_bg_rgb8(n, 0, 0xff, 0);
|
||||
ncdirect_printf_aligned(n, -1, NCALIGN_CENTER, "let's play!");
|
||||
if(ncdirect_render_image(n, "../data/normal.png", NCALIGN_LEFT,
|
||||
NCBLIT_DEFAULT, NCSCALE_STRETCH)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
if(ncdirect_render_image(n, "../data/normal.png", NCALIGN_CENTER,
|
||||
NCBLIT_DEFAULT, NCSCALE_STRETCH)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
if(ncdirect_render_image(n, "../data/normal.png", NCALIGN_RIGHT,
|
||||
NCBLIT_DEFAULT, NCSCALE_STRETCH)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
sleep(1);
|
||||
if(ncdirect_clear(n)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
if(ncdirect_render_image(n, "../data/changes.jpg", NCALIGN_LEFT,
|
||||
NCBLIT_DEFAULT, NCSCALE_SCALE)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
if(ncdirect_render_image(n, "../data/changes.jpg", NCALIGN_CENTER,
|
||||
NCBLIT_DEFAULT, NCSCALE_SCALE)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
if(ncdirect_render_image(n, "../data/changes.jpg", NCALIGN_RIGHT,
|
||||
NCBLIT_DEFAULT, NCSCALE_SCALE)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
sleep(1);
|
||||
if(ncdirect_clear(n)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
if(ncdirect_render_image(n, "../data/warmech.bmp", NCALIGN_RIGHT,
|
||||
NCBLIT_DEFAULT, NCSCALE_NONE)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
if(ncdirect_render_image(n, "../data/warmech.bmp", NCALIGN_LEFT,
|
||||
NCBLIT_DEFAULT, NCSCALE_NONE)){
|
||||
return EXIT_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
if(ncdirect_stop(n)){
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
err:
|
||||
ncdirect_stop(n);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user