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

Bob Pendleton bob at pendleton.com
Tue Aug 29 07:32:03 PDT 2006


On Sun, 2006-08-27 at 01:22 -0700, Sam Lantinga wrote:
> > > 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? ;-)
> 
> > Implementation? :)
> > Adding a feature to the existing software blitters is a daunting prospect,
> > since the complexity increases exponentially.
> 
> On an amusing note, I put together a script to generate the blit combinations
> needed for 32-bit pixel formats in 1.3, and it generated on the order of 800
> blitters, and the resulting object code was as big as the entire rest of the
> library combined.

I once wrote code to generate a fully optimized 4x4 matrix multiplier.
It looked at all place in the matrices that were either 0 or 1 and used
a switch statement to select a custom multiply that minimized the number
of adds and multiplies. (This was back in the 386/486 era when floating
point was very slow...) The resulting file was so large with a switch
statement with so many entries that no compiler I could find could
compile it. 

> 
> I think I'll need to pare down some functionality and add some multi-purpose
> blitters in order to make this reasonable... :)

Yeah... there are probably less than 20 special cases that are worth
optimizing.

> 
> 	-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Bob Pendleton

> 
> _______________________________________________
> 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