The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Alpha-blended Surface Blitting Works very slow.. why and how
Robin Kaup
Guest

Do you have the latest drivers for your GPU?

On 10 December 2012 10:59, axt32 wrote:
Quote:





Hi.


Alpha-blended Surface Blitting Works very slow.. (framerate is downed about 60.0 to 9.0 fps....)


Alpha-blended surface is filled of about 240x420x24 scale pixels.... (without rotation and zoom by sdl_gfx)


My SDL Program is run on Windows 7. (compiled by visual studio 2010, SDL 1.2)


i checked the flags 'SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN',


Screen Surface is set that flags and bpp is set to '32' (but, '24 bpp' can't solve the problem)


why and how to solve this???

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Alpha-blended Surface Blitting Works very slow.. why and how
Jonny D


Joined: 12 Sep 2009
Posts: 932
Are you using SDL_DisplayFormatAlpha()?  Also, don't expect really great framerates from SDL 1.2.  The new version in development, SDL 1.3, uses the GPU whereas SDL 1.2 renders using the CPU.

Jonny D


On Mon, Dec 10, 2012 at 6:45 AM, Robin Kaup wrote:
Quote:
Do you have the latest drivers for your GPU?

On 10 December 2012 10:59, axt32 wrote:


Quote:





Hi.


Alpha-blended Surface Blitting Works very slow.. (framerate is downed about 60.0 to 9.0 fps....)


Alpha-blended surface is filled of about 240x420x24 scale pixels.... (without rotation and zoom by sdl_gfx)


My SDL Program is run on Windows 7. (compiled by visual studio 2010, SDL 1.2)


i checked the flags 'SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN',


Screen Surface is set that flags and bpp is set to '32' (but, '24 bpp' can't solve the problem)


why and how to solve this???



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Alpha-blended Surface Blitting Works very slow.. why and how
Torsten Giebl


Joined: 12 Sep 2009
Posts: 172
Hello !


Quote:
Alpha-blended Surface Blitting Works very slow.. (framerate is downed about 60.0 to 9.0 fps....)
Alpha-blended surface is filled of about 240x420x24 scale pixels.... (without rotation and zoom by sdl_gfx)
My SDL Program is run on Windows 7. (compiled by visual studio 2010, SDL 1.2)
i checked the flags 'SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN',
Screen Surface is set that flags and bpp is set to '32' (but, '24 bpp' can't solve the problem)

why and how to solve this???

SDL 1.2 does Alpha Blending only in software, no matter if
Windows or Linux or whatever OS, the only real solution is to change
to SDL 2.0.


CU
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alpha-blended Surface Blitting Works very slow.. why and how
Gabriele Greco
Guest

Alpha-blended surface is filled of about 240x420x24 scale pixels.... (without rotation and zoom by sdl_gfx)
Quote:



My SDL Program is run on Windows 7. (compiled by visual studio 2010, SDL 1.2)


i checked the flags 'SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN',




Two things can help you to solve this problem:


1) If you already don't do it convert all your "source" surfaces to the display format with SDL_DisplayFormatAlpha


2) Use SDL_SWSURFACE and remove SDL_DOUBLEBUF, since software alpha blending requires reading the destination surface, sw blitting is faster if the destination surface is software. 


As alternative use SDL 2.0 with SDL_Textures instead of SDL_Surfaces (texture API is hardware accelerated on all architectures).



--
Bye,
 Gabry