diff options
| author | Levent Kaya <42411502+lvntky@users.noreply.github.com> | 2024-11-28 01:01:46 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-28 01:01:46 +0300 |
| commit | 8b25ef20ab3ffa29238f8b4bb2c6c0b7ec886caa (patch) | |
| tree | 84f143235b5e1e6f1d9d06764ac35addd4b97f5e /examples/texture_show_fps.c | |
| parent | eff7f86c4b81e804b13c5606fcc73a6dbfa58677 (diff) | |
| parent | 528209831fc8f188df895acae83174bb81996c96 (diff) | |
Merge pull request #12 from dario-loi/master
Code quality and warning removal
Diffstat (limited to 'examples/texture_show_fps.c')
| -rw-r--r-- | examples/texture_show_fps.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/texture_show_fps.c b/examples/texture_show_fps.c index 90ddc4f..df54115 100644 --- a/examples/texture_show_fps.c +++ b/examples/texture_show_fps.c @@ -20,6 +20,12 @@ char *float_to_string(float value) int main(int argc, char **argv) { + if (argc < 3) { + fprintf(stderr, "Usage: %s <texture_path> <font_path>\n", + argv[0]); + return EXIT_FAILURE; + } + // Initialize framebuffer fbgl_t framebuffer; if (fbgl_init(NULL, &framebuffer) != 0) { @@ -78,7 +84,11 @@ int main(int argc, char **argv) fbgl_render_psf1_text(&framebuffer, font, fps, 100, 0, 0xFF0000); - usleep(50000); // Delay to make the marquee effect visible (adjust as needed) + free(fps); + + nanosleep( + (struct timespec[]){ { 0, (int)5e7 } }, + NULL); // Delay to make the marquee effect visible (adjust as needed) framesize--; } |
