this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added rectangle drawing functions which accept a GPU_Rect: GPU_Rectangle2(), GPU_RectangleFilled2(), GPU_RectangleRound2(), and GPU_RectangleRoundFilled2().

+54
+30
include/SDL_gpu.h
··· 1380 1380 */ 1381 1381 DECLSPEC void SDLCALL GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 1382 1382 1383 + /*! Renders a colored rectangle outline. 1384 + * \param target The destination render target 1385 + * \param rect The rectangular area to draw 1386 + * \param color The color of the shape to render 1387 + */ 1388 + DECLSPEC void SDLCALL GPU_Rectangle2(GPU_Target* target, GPU_Rect rect, SDL_Color color); 1389 + 1383 1390 /*! Renders a colored filled rectangle. 1384 1391 * \param target The destination render target 1385 1392 * \param x1 x-coord of top-left corner ··· 1390 1397 */ 1391 1398 DECLSPEC void SDLCALL GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 1392 1399 1400 + /*! Renders a colored filled rectangle. 1401 + * \param target The destination render target 1402 + * \param rect The rectangular area to draw 1403 + * \param color The color of the shape to render 1404 + */ 1405 + DECLSPEC void SDLCALL GPU_RectangleFilled2(GPU_Target* target, GPU_Rect rect, SDL_Color color); 1406 + 1393 1407 /*! Renders a colored rounded (filleted) rectangle outline. 1394 1408 * \param target The destination render target 1395 1409 * \param x1 x-coord of top-left corner ··· 1401 1415 */ 1402 1416 DECLSPEC void SDLCALL GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 1403 1417 1418 + /*! Renders a colored rounded (filleted) rectangle outline. 1419 + * \param target The destination render target 1420 + * \param rect The rectangular area to draw 1421 + * \param radius The radius of the corners 1422 + * \param color The color of the shape to render 1423 + */ 1424 + DECLSPEC void SDLCALL GPU_RectangleRound2(GPU_Target* target, GPU_Rect rect, float radius, SDL_Color color); 1425 + 1404 1426 /*! Renders a colored filled rounded (filleted) rectangle. 1405 1427 * \param target The destination render target 1406 1428 * \param x1 x-coord of top-left corner ··· 1411 1433 * \param color The color of the shape to render 1412 1434 */ 1413 1435 DECLSPEC void SDLCALL GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 1436 + 1437 + /*! Renders a colored filled rounded (filleted) rectangle. 1438 + * \param target The destination render target 1439 + * \param rect The rectangular area to draw 1440 + * \param radius The radius of the corners 1441 + * \param color The color of the shape to render 1442 + */ 1443 + DECLSPEC void SDLCALL GPU_RectangleRoundFilled2(GPU_Target* target, GPU_Rect rect, float radius, SDL_Color color); 1414 1444 1415 1445 /*! Renders a colored polygon outline. The vertices are expected to define a convex polygon. 1416 1446 * \param target The destination render target
+24
src/SDL_gpu_shapes.c
··· 105 105 renderer->impl->Rectangle(renderer, target, x1, y1, x2, y2, color); 106 106 } 107 107 108 + void GPU_Rectangle2(GPU_Target* target, GPU_Rect rect, SDL_Color color) 109 + { 110 + CHECK_RENDERER(); 111 + renderer->impl->Rectangle(renderer, target, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, color); 112 + } 113 + 108 114 void GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color) 109 115 { 110 116 CHECK_RENDERER(); 111 117 renderer->impl->RectangleFilled(renderer, target, x1, y1, x2, y2, color); 118 + } 119 + 120 + void GPU_RectangleFilled2(GPU_Target* target, GPU_Rect rect, SDL_Color color) 121 + { 122 + CHECK_RENDERER(); 123 + renderer->impl->RectangleFilled(renderer, target, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, color); 112 124 } 113 125 114 126 void GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color) ··· 117 129 renderer->impl->RectangleRound(renderer, target, x1, y1, x2, y2, radius, color); 118 130 } 119 131 132 + void GPU_RectangleRound2(GPU_Target* target, GPU_Rect rect, float radius, SDL_Color color) 133 + { 134 + CHECK_RENDERER(); 135 + renderer->impl->RectangleRound(renderer, target, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, radius, color); 136 + } 137 + 120 138 void GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color) 121 139 { 122 140 CHECK_RENDERER(); 123 141 renderer->impl->RectangleRoundFilled(renderer, target, x1, y1, x2, y2, radius, color); 142 + } 143 + 144 + void GPU_RectangleRoundFilled2(GPU_Target* target, GPU_Rect rect, float radius, SDL_Color color) 145 + { 146 + CHECK_RENDERER(); 147 + renderer->impl->RectangleRoundFilled(renderer, target, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, radius, color); 124 148 } 125 149 126 150 void GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color)