Add SDL_RenderDebugTextF & SDL_RenderDebugTextV

This should make it easier to quickly put important numbers and such on
the screen without having to format them into a string manually.
This commit is contained in:
williamistGitHub 2024-12-07 00:14:55 -05:00 committed by Ryan C. Gordon
parent 5608bf5866
commit 1d0e28a5b3
8 changed files with 126 additions and 2 deletions

View file

@ -62,6 +62,9 @@ SDL_AppResult SDL_AppIterate(void *appstate)
SDL_RenderDebugText(renderer, 14, 65, "It can be scaled.");
SDL_SetRenderScale(renderer, 1.0f, 1.0f);
SDL_RenderDebugText(renderer, 64, 350, "This only does ASCII chars. So this laughing emoji won't draw: 🤣");
SDL_RenderDebugTextF(renderer, 0, 0, "This program has been running for %llu seconds.", SDL_GetTicks() / 1000);
SDL_RenderPresent(renderer); /* put it all on the screen! */
return SDL_APP_CONTINUE; /* carry on with the program! */