core: add support for SPLASH_TEXTBOX in splash-functions.sh
[fbsplash.git] / core / misc / splashtest.c
blob71ec2c90c322218b14cbb23ec6d83a591b9c1870
1 /*
2 * splashtest.c
4 * A simple program to demonstrate the use of the fbsplashrender library.
6 */
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include <unistd.h>
11 #include <fbsplash.h>
13 int main(int argc, char **argv)
15 struct fbspl_theme *theme;
16 int tty = 0;
18 fbsplash_lib_init(fbspl_bootup);
19 fbsplash_acc_theme_set("test");
21 fbsplashr_init(false);
22 theme = fbsplashr_theme_load();
23 if (!theme) {
24 fprintf(stderr, "Failed to load theme.\n");
25 return 1;
28 tty = fbsplash_set_silent();
29 fbsplashr_tty_silent_init(true);
30 fbsplashr_tty_silent_update();
31 fbsplashr_render_screen(theme, true, false, FBSPL_EFF_FADEIN);
32 sleep(2);
33 fbsplashr_render_screen(theme, true, false, FBSPL_EFF_FADEOUT);
34 fbsplashr_tty_silent_cleanup();
35 fbsplash_set_verbose(tty);
37 fbsplashr_theme_free(theme);
38 fbsplashr_cleanup();
39 fbsplash_lib_cleanup();
41 return 0;