From 65ba649b36634a78d1317d5cd9747fa83e61f29f Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 7 Dec 2017 23:03:04 +1100 Subject: [PATCH] [host/test] vertical align the text too --- host/sync-test/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/host/sync-test/main.c b/host/sync-test/main.c index 56e93724..37bdd664 100644 --- a/host/sync-test/main.c +++ b/host/sync-test/main.c @@ -87,12 +87,13 @@ int main(int argc, char * argv[]) const SDL_Color c = {0x00, 0xff, 0x00, 0xff}; char text[128]; - snprintf(text, sizeof(text), "FPS: %5.2f, Frame: %05u \"F11\" to toggle Full Screen", fps, frameCount); + snprintf(text, sizeof(text), "FPS: %7.4f, Frame: %05u \"F11\" to toggle Full Screen", fps, frameCount); SDL_Surface * fpsSurf = TTF_RenderText_Solid(fpsFont, text, c); if (fpsText) SDL_DestroyTexture(fpsText); fpsText = SDL_CreateTextureFromSurface(renderer, fpsSurf); fpsTextRect.x = width / 2 - fpsSurf->w / 2; + fpsTextRect.y = 20 - fpsSurf->h / 2; fpsTextRect.w = fpsSurf->w; fpsTextRect.h = fpsSurf->h; SDL_FreeSurface(fpsSurf);