[SDL] Questions about SDL 1.3

Mason Wheeler masonwheeler at yahoo.com
Mon Dec 27 09:37:28 PST 2010

I had similar problems, so I wrote up a patch to implement #3.  I submitted it 
back in April, and apparently it's never been touched or looked at since. :(


This is for the OpenGL renderer only, but similar concepts exist in Direct3D and 
you shouldn't have too much trouble extending it if that's what you're using.

From: ebyard <e_byard at yahoo.co.uk>
To: sdl at lists.libsdl.org
Sent: Mon, December 27, 2010 8:59:14 AM
Subject: Re: [SDL] Questions about SDL 1.3



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 

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...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101227/a5b2f82b/attachment-0008.htm>

More information about the SDL mailing list