The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Texture as both a source and destination?
nmapp


Joined: 03 Jun 2016
Posts: 5
Lets say I have an SDL_Texture and I set it as a render target. Is it possible then to use that texture as a source in SDL_RenderCopy? (to copy onto itself?) In other words: does SDL_RenderCopy have the semantics of memmove(), or is it more like memcpy()?
Sorry, I don't have access to computer with SDL2 installed right now. And even if it works, I want to know whether it's legal and supported, or "undefined behaviour".
Texture as both a source and destination?
Alex Szpakowski
Guest

GPUs (and graphics drivers) don’t support that – so SDL_RenderCopy behaves like memcpy rather than memmove in that manner.
Quote:
On Oct 13, 2016, at 12:45 AM, nmapp wrote:
Lets say I have an SDL_Texture and I set it as a render target. Is it possible then to use that texture as a source in SDL_RenderCopy? (to copy onto itself?) In other words: does SDL_RenderCopy have the semantics of memmove(), or is it more like memcpy()?Sorry, I don't have access to computer with SDL2 installed right now. And even if it works, I want to know whether it's legal and supported, or "undefined behaviour".
_______________________________________________SDL mailinghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: Texture as both a source and destination?
nmapp


Joined: 03 Jun 2016
Posts: 5
Alex Szpakowski wrote:
GPUs (and graphics drivers) don’t support that – so SDL_RenderCopy behaves like memcpy rather than memmove in that manner.

Thank you. Yeah, it doesn't work at all, guess I'll have to use two textures and swap between them...