mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user