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

Function SDL_RenderDrawPointsF

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

Source from the content-addressed store, hash-verified

2378}
2379
2380int
2381SDL_RenderDrawPointsF(SDL_Renderer * renderer,
2382 const SDL_FPoint * points, int count)
2383{
2384 SDL_FPoint *fpoints;
2385 int i;
2386 int retval;
2387 SDL_bool isstack;
2388
2389 CHECK_RENDERER_MAGIC(renderer, -1);
2390
2391 if (!points) {
2392 return SDL_SetError("SDL_RenderDrawFPoints(): Passed NULL points");
2393 }
2394 if (count < 1) {
2395 return 0;
2396 }
2397
2398 /* Don't draw while we're hidden */
2399 if (renderer->hidden) {
2400 return 0;
2401 }
2402
2403 if (renderer->scale.x != 1.0f || renderer->scale.y != 1.0f) {
2404 return RenderDrawPointsWithRectsF(renderer, points, count);
2405 }
2406
2407 fpoints = SDL_small_alloc(SDL_FPoint, count, &isstack);
2408 if (!fpoints) {
2409 return SDL_OutOfMemory();
2410 }
2411 for (i = 0; i < count; ++i) {
2412 fpoints[i].x = points[i].x * renderer->scale.x;
2413 fpoints[i].y = points[i].y * renderer->scale.y;
2414 }
2415
2416 retval = QueueCmdDrawPoints(renderer, fpoints, count);
2417
2418 SDL_small_free(fpoints, isstack);
2419
2420 return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer);
2421}
2422
2423int
2424SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)

Callers 2

SDL_RenderDrawPointFunction · 0.85
SDL_RenderDrawPointFFunction · 0.85

Calls 4

SDL_SetErrorFunction · 0.85
QueueCmdDrawPointsFunction · 0.85

Tested by

no test coverage detected