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

Function DrawRectLineIntersections

deps/SDL2/test/testintersections.c:161–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161static void
162DrawRectLineIntersections(SDL_Renderer * renderer)
163{
164 int i, j;
165
166 SDL_SetRenderDrawColor(renderer, 0, 255, 55, 255);
167
168 for (i = 0; i < num_rects; i++)
169 for (j = 0; j < num_lines; j++) {
170 int x1, y1, x2, y2;
171 SDL_Rect r;
172
173 r = rects[i];
174 x1 = lines[j].x;
175 y1 = lines[j].y;
176 x2 = lines[j].w;
177 y2 = lines[j].h;
178
179 if (SDL_IntersectRectAndLine(&r, &x1, &y1, &x2, &y2)) {
180 SDL_RenderDrawLine(renderer, x1, y1, x2, y2);
181 }
182 }
183}
184
185static void
186DrawRectRectIntersections(SDL_Renderer * renderer)

Callers 1

loopFunction · 0.85

Calls 3

SDL_SetRenderDrawColorFunction · 0.85
SDL_IntersectRectAndLineFunction · 0.85
SDL_RenderDrawLineFunction · 0.85

Tested by

no test coverage detected