MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / RenderDrawPointsWithRects

Function RenderDrawPointsWithRects

deps/SDL2/src/render/SDL_render.c:2283–2308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2281}
2282
2283static int
2284RenderDrawPointsWithRects(SDL_Renderer * renderer,
2285 const SDL_Point * points, const int count)
2286{
2287 int retval = -1;
2288 SDL_bool isstack;
2289 SDL_FRect *frects = SDL_small_alloc(SDL_FRect, count, &isstack);
2290 int i;
2291
2292 if (!frects) {
2293 return SDL_OutOfMemory();
2294 }
2295
2296 for (i = 0; i < count; ++i) {
2297 frects[i].x = points[i].x * renderer->scale.x;
2298 frects[i].y = points[i].y * renderer->scale.y;
2299 frects[i].w = renderer->scale.x;
2300 frects[i].h = renderer->scale.y;
2301 }
2302
2303 retval = QueueCmdFillRects(renderer, frects, count);
2304
2305 SDL_small_free(frects, isstack);
2306
2307 return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer);
2308}
2309
2310int
2311SDL_RenderDrawPoints(SDL_Renderer * renderer,

Callers 1

SDL_RenderDrawPointsFunction · 0.85

Calls 2

QueueCmdFillRectsFunction · 0.85

Tested by

no test coverage detected