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

Function SDL_RenderFillRectsF

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

Source from the content-addressed store, hash-verified

2831}
2832
2833int
2834SDL_RenderFillRectsF(SDL_Renderer * renderer,
2835 const SDL_FRect * rects, int count)
2836{
2837 SDL_FRect *frects;
2838 int i;
2839 int retval;
2840 SDL_bool isstack;
2841
2842 CHECK_RENDERER_MAGIC(renderer, -1);
2843
2844 if (!rects) {
2845 return SDL_SetError("SDL_RenderFillFRects(): Passed NULL rects");
2846 }
2847 if (count < 1) {
2848 return 0;
2849 }
2850
2851 /* Don't draw while we're hidden */
2852 if (renderer->hidden) {
2853 return 0;
2854 }
2855
2856 frects = SDL_small_alloc(SDL_FRect, count, &isstack);
2857 if (!frects) {
2858 return SDL_OutOfMemory();
2859 }
2860 for (i = 0; i < count; ++i) {
2861 frects[i].x = rects[i].x * renderer->scale.x;
2862 frects[i].y = rects[i].y * renderer->scale.y;
2863 frects[i].w = rects[i].w * renderer->scale.x;
2864 frects[i].h = rects[i].h * renderer->scale.y;
2865 }
2866
2867 retval = QueueCmdFillRects(renderer, frects, count);
2868
2869 SDL_small_free(frects, isstack);
2870
2871 return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer);
2872}
2873
2874/* !!! FIXME: move this to a public API if we want to do float versions of all of these later */
2875SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r)

Callers 2

SDL_RenderFillRectFunction · 0.85
SDL_RenderFillRectFFunction · 0.85

Calls 3

SDL_SetErrorFunction · 0.85
QueueCmdFillRectsFunction · 0.85

Tested by

no test coverage detected