[SDL] Questions about SDL 1.3
e_byard at yahoo.co.uk
Mon Dec 27 08:59:14 PST 2010
> 1.) How do I draw stuff directly to a SDL_Texture? Currently I am blitting to a SDL_Surface then using SDL_CreateTextureFromSurface to convert it for SDL_RenderCopy. I feel that there should be a more efficient way to do this, but I can't find a function that does direct drawing to a texture in the new api documentation.
I have had to do this on a project. It is horrifically inefficient - ~58ms to convert a 1024x768 surface to a texture and display it, and I have 2 windows, so double that. I really do not know how to fix this.
If SDL 1.3 is made to be able to be a "frame" based system then there needs to be a way to either:
1. render a surface directly to a window
2. convert a surface to a texture very quickly
3. copy a portion of a texture to another texture quickly, which can then be rendered to the screen
There's also a big question mark over scaling in 1.3 - I can see no fast /easy way to draw a new frame and then scale it. I draw lots of small rectangles from a large texture on to the screen - problem is you can't scale with this method as there is no way to fast-copy between textures.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL