Convert texture to surface |
Convert texture to surface |
Pallav Nawani
|
You can render a texture to another texture, but you can't render a texture to surface. However, you can access the texture data from the current rendering target by using:Â SDL_RenderReadPixels(). So you might do:
1. Create a renderaccess texture A. 2. Set A as render target 3. Render to it 4. Read pixels by using SDL_RenderReadPixels(). 5. Revert to original render target It would be an extremely slow process. SO perhaps its just better to cache the original surface. Pallav Nawani IronCode Gaming Private Limited Website: http://www.ironcode.com Twitter: http://twitter.com/Ironcode_Gaming Facebook: http://www.facebook.com/Ironcode.Gaming Mobile: 9997478768 On Thu, Aug 28, 2014 at 2:11 AM, MrTAToad wrote:
|
|||||||||||||
|
MrTAToad
|
Thanks for that - it is a shame as it means using a bit of extra memori
|
|||||||||||
|