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

Function QueueCmdSetClipRect

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

Source from the content-addressed store, hash-verified

346}
347
348static int
349QueueCmdSetClipRect(SDL_Renderer *renderer)
350{
351 int retval = 0;
352 if ((!renderer->cliprect_queued) ||
353 (renderer->clipping_enabled != renderer->last_queued_cliprect_enabled) ||
354 (SDL_memcmp(&renderer->clip_rect, &renderer->last_queued_cliprect, sizeof (SDL_Rect)) != 0)) {
355 SDL_RenderCommand *cmd = AllocateRenderCommand(renderer);
356 if (cmd == NULL) {
357 retval = -1;
358 } else {
359 cmd->command = SDL_RENDERCMD_SETCLIPRECT;
360 cmd->data.cliprect.enabled = renderer->clipping_enabled;
361 SDL_memcpy(&cmd->data.cliprect.rect, &renderer->clip_rect, sizeof (cmd->data.cliprect.rect));
362 SDL_memcpy(&renderer->last_queued_cliprect, &renderer->clip_rect, sizeof (SDL_Rect));
363 renderer->last_queued_cliprect_enabled = renderer->clipping_enabled;
364 renderer->cliprect_queued = SDL_TRUE;
365 }
366 }
367 return retval;
368}
369
370static int
371QueueCmdSetDrawColor(SDL_Renderer *renderer, const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a)

Callers 3

PrepQueueCmdDrawFunction · 0.85
SDL_SetRenderTargetFunction · 0.85
SDL_RenderSetClipRectFunction · 0.85

Calls 3

SDL_memcmpFunction · 0.85
AllocateRenderCommandFunction · 0.85
SDL_memcpyFunction · 0.85

Tested by

no test coverage detected