Reputation: 39
I am using C++ and SDL 2. Is there any function in SDL or any available algorithm to clear only a part of the screen?
I tried using SDL_RenderSetViewPort()
in the following way but it didn't work:
SDL_RenderSetViewPort(renderer,&rect);
SDL_RenderClear(renderer);
I thought that the specific texture present in the given rectangle part would be cleared but it didn't.
Upvotes: 0
Views: 443
Reputation: 52082
SDL_SetRenderDrawColor()
with the clear color then SDL_RenderFillRect()
with the desired region to 'clear'.
Upvotes: 3