mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-25 23:13:39 +00:00
[host/test] vertical align the text too
This commit is contained in:
parent
7d7074e9f6
commit
65ba649b36
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user