[SDL] Accelerated Alpha Blending in SDL ?

Sebastian Beschke sebastian.beschke at student.uni-tuebingen.de
Sun Jul 23 12:09:23 PDT 2006


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




More information about the SDL mailing list