Removed non-float versions of SDL render API drawing functions

This simplifies the API and removes a level of API translation between the int variants of the functions and the float implementation

Fixes https://github.com/libsdl-org/SDL/issues/6656
This commit is contained in:
Sam Lantinga
2022-12-31 11:19:32 -08:00
parent bf76fc6b05
commit 9c1a9ecb4b
29 changed files with 465 additions and 1119 deletions

View File

@@ -29,7 +29,8 @@ int done;
void DrawChessBoard()
{
int row = 0, column = 0, x = 0;
SDL_Rect rect, darea;
SDL_FRect rect;
SDL_Rect darea;
/* Get the Size of drawing surface */
SDL_GetRenderViewport(renderer, &darea);
@@ -40,10 +41,10 @@ void DrawChessBoard()
for (; column < 4 + (row % 2); column++) {
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0xFF);
rect.w = darea.w / 8;
rect.h = darea.h / 8;
rect.x = x * rect.w;
rect.y = row * rect.h;
rect.w = (float)(darea.w / 8);
rect.h = (float)(darea.h / 8);
rect.x = (float)(x * rect.w);
rect.y = (float)(row * rect.h);
x = x + 2;
SDL_RenderFillRect(renderer, &rect);
}