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

Bob Pendleton bob at pendleton.com
Thu Aug 17 14:30:47 PDT 2006


On Thu, 2006-08-17 at 15:41 +0200, David Olofson wrote:
> 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? ;-)

You really need to include full support for alpha and it would be nice
to have support for a simple set of graphic primitives such as point,
line, tri/strips/fans, quad/strips, and so on. Not difficult to
implement. Then there is the problem that a software renderer needs to
support a lot of different pixel depths so that multiplies the amount of
code and there are all sorts of special instruction sets that the
machine may or may not support that will improve performance.

I can go on and on and on listing things that people would like in SDL.
We have to be very careful about what gets added or you wind up trying
to add the kitchen sink. Fortunately, Sam is realy good at saying
"no". :-)

		Bob Pendleton

> 
> 
> > 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  --'
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
> 
-- 
+--------------------------------------+
+ Bob Pendleton: writer and programmer +
+ email: Bob at Pendleton.com             +
+ web: www.GameProgrammer.com          +
+ www.Wise2Food.com                    +
+ nutrient info on 7,000+ common foods +
+--------------------------------------+






More information about the SDL mailing list