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
SDL 2 SDL_Texture scaling and rotating
BJ


Joined: 01 May 2012
Posts: 18
Location: Australia
I am writing a find a word mobile app.

To create the strike out effect I am using 3 textures.




This is so the ends won't look funny when scaled. I have tried to scale the middle image but it gets offset to some location, that I cannot figure out how to get it to render in the correct location.
So I changed to rendering multiple copies of the middle texture to fill in the space (see image below for the result). This works, but when the puzzle is nearly complete there is a noticeable frame rate drop.



Can some one either tell me how to get a single middle image to scale and rotate so that is is correctly positioned; or is it possible to copy from an SDL_Texture with SDL_TEXTUREACCESS_TARGET access to an SDL_Texture with SDL_TEXTUREACCESS_STREAMING access. As I can copy the final drawn image to an image with SDL_TEXTUREACCESS_TARGET, I would like to then render it back to the original image and this would solve the speed problem.

Thanks