--- a/test/sandbox.c Mon Dec 18 19:05:30 2023 +0100 +++ b/test/sandbox.c Thu Jan 18 21:53:16 2024 +0100 @@ -54,7 +54,7 @@ asc_set_font(asc_font(ASC_FONT_REGULAR, 24)); asc_ink_rgb(255, 0, 0); - AscTextNode *fps_counter = asc_text(50, 50, "60 FPS"); + AscTextNode *fps_counter = asc_text(50, 50, "9999 FPS"); unsigned last_fps = 0; while (asc_loop_next()) { @@ -67,8 +67,7 @@ unsigned fps = 1000u / asc_context.elapsed_millis; if (fps != last_fps) { last_fps = fps; - cxBufferReset(&fps_counter->text); - cx_bprintf(&fps_counter->text, "%u FPS", fps); + snprintf(fps_counter->text, 9, "%u FPS", fps); asc_text_update(fps_counter); } }