Accelerated Alpha Blending in SDL?

1.Why doesn’t SDL support h/w accelerated Alpha blending ? Will this issue be fixed in the future (1.3)?

2.If i use openGL with SDL, to allow me to use h/w accl alpha blending then can i still use SDL_Surfaces ? Else is it possible to put sprites in hardware memory
using openGL. Is it possible to carry out 2d graphics using openGL & using hardware memory. Does openGL allow direct use of the hardware memory & accessing video buffer pixels?

3.By the way i heard that parts of SDL are in assembly. But wont the compiler generate assembly code anyway ? Does hand coding the assembly allow more efficient code than that generated by the compiler?---------------------------------
How low will we go? Check out Yahoo! Messenger?s low PC-to-Phone call rates.

Hello !

1.Why doesn’t SDL support h/w accelerated Alpha blending ? Will this
issue be fixed in the future (1.3)?

2.If i use openGL with SDL, to allow me to use h/w accl alpha blending
then can i still use SDL_Surfaces ? Else is it possible to put sprites
in hardware memory using openGL. Is it possible to carry out 2d graphics
using openGL & using hardware memory. Does openGL allow direct use of
the hardware memory & accessing video buffer pixels?

SDL 1.3 will rock. It supports Multi Windows, HW Alpha Blending and
so on. At the moment you can test SDL 1.3 with testsprite and testsprite2
on Windows. Mac OS X is currently in progress.

CU

Hi!

Abhijit Nandy schrieb:

2.If i use openGL with SDL, to allow me to use h/w accl alpha blending then can i still use SDL_Surfaces ? Else is it possible to put sprites in hardware memory
using openGL. Is it possible to carry out 2d graphics using openGL & using hardware memory. Does openGL allow direct use of the hardware memory & accessing video buffer pixels?

You can upload your sprites as OpenGL textures and apply them to
rectangles using the OpenGL commands (use orthogonal projection). A lot
of people do this, it’s much faster than software blitting (if the
hardware supports it).
I’m not really sure about the amount of modification OpenGL lets you
perform on graphics memory. In the worst case, you’d have to upload a
new texture.

When working with OpenGL, you’d be using the SDL commands only to set up
a video mode and for event handling, i.e. you wouldn’t use SDL_Surface
or SDL_BlitSurface() and such (except maybe for loading/modification
purposes).

3.By the way i heard that parts of SDL are in assembly. But wont the compiler generate assembly code anyway ? Does hand coding the assembly allow more efficient code than that generated by the compiler?

Yes. Why else would you do it?

Sebastian

3.By the way i heard that parts of SDL are in assembly. But wont the
compiler generate assembly code anyway ? Does hand coding the assembly
allow more efficient code than that generated by the compiler?

In these cases, yes. Otherwise, we wouldn’t put up with all the hassle
it causes in terms of maintenance.

–ryan.

Abhijit Nandy wrote:

1.Why doesn’t SDL support h/w accelerated Alpha blending ? Will this issue be fixed in the future (1.3)?

Because it was never implemented in DirectDraw.

3.By the way i heard that parts of SDL are in assembly. But wont the compiler generate assembly code anyway ? Does hand coding the assembly allow more efficient code than that generated by the compiler?

Yes. The compiler doesn’t know exactly what you’re trying to do, so
writing a hand tuned routine in assembly is usually a lot faster. The
blitter routines in SDL further use MMX to speed things up.

Pete.