[SDL] Hardware per pixel alpha blitting

Amir Cicak krib at lappasoft.com
Fri Aug 19 12:09:37 PDT 2005


Hello, can someone show me code for loading PNG with alpha in HW surface and 
blitting it using hwaccel? I am using SDL_image library (IMG_Load) to load 
bmp, and although I open display in HW doublebuf mode, surfaces are never 
loaded in video mem. Also on my geforce 6600 I get these caps:

vi->hw_available: 1
vi->wm_available: 1
vi->blit_hw: 1
vi->blit_hw_CC: 1
vi->blit_hw_A: 0
vi->blit_sw: 1
vi->blit_sw_CC: 1
vi->blit_sw_A: 0
vi->blit_fill: 1
vi->video_mem: 124284
vi->vfmt->BitsPerPixel: 16
vi->vfmt->BytesPerPixel: 2
vi->vfmt->colorkey: 0
vi->vfmt->alpha: 255
vi->vfmt->Rmask, Gmask, Bmask, Amask: 63488, 2016, 31, 0
vi->vfmt->Rshift, Gshift, Bshift, Ashift: 11, 5, 0, 0
vi->vfmt->Rmask, Rloss, Gloss, Bloss, Aloss: 3, 2, 3, 8

I also tried SDL_ConvertSurface(img, img->format, SDL_HWSURFACE|SDL_HWACCEL);, 
with no success.

Why is blit_hw_A 0, and blit_sw_A 0, on this card? What is the simplest way to 
load png alpha (per pixel) image into video surface (and/or system mem) and 
blit it using hardware acceleration? Is it possible at all? If not whats the 
fastest way to blit alpha PNG?

Thank you in advance.








More information about the SDL mailing list