diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/plottest.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/plottest.c b/test/plottest.c index 8be921e..74134c4 100644 --- a/test/plottest.c +++ b/test/plottest.c @@ -70,6 +70,7 @@ const struct { int main(int argc, char **argv) { nsfb_t *nsfb; + int bpp; nsfb_event_t event; nsfb_bbox_t box; nsfb_bbox_t box2; @@ -80,8 +81,13 @@ int main(int argc, char **argv) int loop; nsfb_plot_pen_t pen; - UNUSED(argc); - UNUSED(argv); + if (argc < 2) { + bpp = 32; + } else { + bpp = atoi(argv[1]); + if (bpp == 0) + bpp = 32; + } nsfb = nsfb_init(NSFB_FRONTEND_SDL); if (nsfb == NULL) { @@ -89,6 +95,12 @@ int main(int argc, char **argv) return 1; } + if (nsfb_set_geometry(nsfb, 0, 0, bpp) == -1) { + fprintf(stderr, "Unable to set geometry\n"); + nsfb_finalise(nsfb); + return 3; + } + if (nsfb_init_frontend(nsfb) == -1) { fprintf(stderr, "Unable to initialise nsfb frontend\n"); return 2; |