-1
\$\begingroup\$

I'd like to debug the SDL_Rect around of my textures visually, what is the best way to draw red lines like an unfilled rectangle around the texture.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You can use the SDL_RenderDrawRect() function to render an outline around a texture.

void Render(void)
{
   SDL_SetRenderDrawColor(pRenderer, 255, 0, 0, 255);

   const SDL_Rect Quad = {TexXPos, TexYPos, TexWidth, TexHeight};

   SDL_RenderDrawRect(pRenderer, &Quad);
}
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .