I’m trying to understand what the point of setting a viewport is and I haven’t found any decent explanation for it. The problem I have is that this code:
// Using a viewport SDL_RenderSetViewport(&renderer, &viewportRect); SDL_RenderCopy(&renderer, &texture, nullptr, nullptr);
produces the exact same result as this code:
// Using a destination rect SDL_RenderCopy(&renderer, &texture, nullptr, &viewportRect);
The only difference I can see is if you try to render something outside of the viewport it isn’t rendered. So what am I missing about this?