SDL_RenderTexture() and SDL_RenderTextureRotated() take floating point source coordinates

See the discussion at https://discourse.libsdl.org/t/sdl-rendercopyf-uses-ints/36732/8
This commit is contained in:
Sam Lantinga 2023-03-02 08:56:54 -08:00
parent 199a7af296
commit bd2e2ee7aa
9 changed files with 82 additions and 75 deletions

View file

@ -3131,7 +3131,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c)
const Uint32 charWidth = FONT_CHARACTER_SIZE;
const Uint32 charHeight = FONT_CHARACTER_SIZE;
const Uint32 charSize = FONT_CHARACTER_SIZE;
SDL_Rect srect;
SDL_FRect srect;
SDL_FRect drect;
int result;
Uint32 ix, iy;
@ -3147,10 +3147,10 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c)
/*
* Setup source rectangle
*/
srect.x = 0;
srect.y = 0;
srect.w = charWidth;
srect.h = charHeight;
srect.x = 0.0f;
srect.y = 0.0f;
srect.w = (float)charWidth;
srect.h = (float)charHeight;
/*
* Setup destination rectangle