[SDL] 2D API evolution (SDL 1.3/2.0)
René Dudfield
renesd at gmail.com
Wed Aug 16 18:30:16 PDT 2006
The sdl gfx functions can do all of this stuff. scale, rotate, and rotozoom.
It is usable in games if your sprites are small, or if you precache
the rotations. eg using say 12 rotations
A fast flip blit would be useful. It is a pretty simple change to the
current blitters to do FLIP blit. Maybe it could be included in the
current blitters with very little speed change... Since then you
would not add much code to it(not a whole different set of blitters
anyway).
A lot of newer chips have scaling built in. The gp2x chip can do
rotation, and scaling in hardware.
For pygame 1.8 we have made the scaling a lot quicker by allowing a
reuse of the destination surface. Before we were creating a new
surface to scale it.
Also in pygame 1.8 we have added some basic new blending modes for per
pixel alpha blits... ADD, SUB, MULT, DIV, MIN, MAX. Note that GDI has
some of these built in, and they are pretty quick. The pygame ones
are not optimized yet, but work ok. I'm going to do some mmx
implementations at some point. At least for the ADD blend... which is
a very much requested mode. Maybe these could go into SDL 1.3?
Another useful surface type would be a 1 bit surface... Then you can
quickly do lighting effects, and other mask like operations. Kind of
like the stencil ops in opengl.
For surfaces, also having floats, and other bit depths may be
useful... or at least having the surface structures being able to use
them.
Yah for SDL 1.3 goodness!
Cheers,
On 8/17/06, Bob Pendleton <bob at pendleton.com> wrote:
> On Wed, 2006-08-16 at 12:13 +0200, Torsten Giebl wrote:
> > Hello !
> >
> >
> > > But you forget that 2D games can have rotations and scaling etc when
> > > done directly using the 3D API's, but SDL 1.3 renderers don't provide such
> > > things. Those simple transformations could be done in SW too in real time
> > > with a litle bit of limited quality as a fall back. And I have to say that
> > > I would think that as a necessity in SDL 1.3. After
> > > all SDL 1.3 is a big leap forward from SDL 1.2 so why restrict the drawing
> > > system to the old?
> >
> >
> > For me it is okay to add these functions to SDL 1.3 + X/Y-Flipping.
>
> Code that can do general rotations can usually do X, Y flipping too. All
> you have to do is flip the texture coordinates. And, while you might not
> think that I really mean "texture" I do. 2D texture operations are a
> simpler (and sometimes faster) version of 3D texture operations. A good
> 2D texture handler can scale, rotate, and flip all at once.
>
> 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 +
> +--------------------------------------+
>
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
More information about the SDL
mailing list