Well, afaik.. Surfaces are stored in client-side memory, so they're actually just abstractions in that sense, whilst the textures are tied to a context which is the renderer and that means it's likely stored on the GPU or as close to video memory as possible (which means they can be hw accelerated). If that's the case, slow or otherwise heavy computations done can benefit greatly from this.
SDL_RenderCopy clips the destination rect against the viewport and then compensates for, or rather adjusts the source appropriately if I'm not mistaken. You would probably benefit from using SDL_RenderCopyEx instead.
heisenberg wrote:Please, can you explain it to me.
When do we use Surface ? And, when do we use Texture in SDL v2 ?
I thought my initial response explained that sufficiently.
You only want to really use surfaces when there's *need* for processing pixels on the CPU, because why be doing things slower when there're clear ways of doing it more efficiently without added layers of complexity on there.
As D-e-X said, use Texture whenever possible to keep the data in VRAM. If you need to do software rendering or processing (sllooww), then use the Surface representation in RAM.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!