[SDL] 2D API evolution (SDL 1.3/2.0)

David Olofson david at olofson.net
Thu Aug 17 06:41:38 PDT 2006


On Thursday 17 August 2006 14:47, Bob Pendleton wrote:
[...]
> > For performance reasons, it *might* be a good idea to keep a
> > dedicated backend call for non-scaled rectangular blits... I
> > dunno.  
> 
> That's a real easy case to detect at run time. Best to just let the
> backend code catch special cases and optimize them.

I was just thinking about the special case testing overhead - but that 
pretty much only applies to fully or partially software rendering 
backends, where a few *pages* more or less of such code is next to 
insignificant even for very small blits.

OpenGL and Direct3D backends, where this starts to matter (*if* you're 
actually doing thousands of tiny blits per frame, that is!) don't 
need to do any special case testing anyway, because that's all 
handled by the driver and/or hardware. Very simple and very fast.

So, using a single four point 2D transforming blit call on the backend 
level does seem like a good idea to me. It's clean, simple, does what 
we need, and plugs trivially right into the relevant 3D APIs.

Ok... This sounds too easy. What are we missing? ;-)


> btw, in the case of scaling 2D textures benefit from MIP maps just
> as much as 3D textures do and using them lets you get away from a
> lot of the need to do pixel level interpolation in the inner loop.

Yes... Which suggests that it makes a lot of sense to build MIPmapping 
support into the core - even if we stop at basic scaling with no 
rotation or other transforms.


//David Olofson - Programmer, Composer, Open Source Advocate

.-------  http://olofson.net - Games, SDL examples  -------.
|        http://zeespace.net - 2.5D rendering engine       |
|       http://audiality.org - Music/audio engine          |
|     http://eel.olofson.net - Real time scripting         |
'--  http://www.reologica.se - Rheology instrumentation  --'




More information about the SDL mailing list