[SDL] About Screen Fading with alpha

김 면수 zakksdl at hotmail.com
Wed Aug 8 02:57:01 PDT 2001


hi..im new to SDL mailing list..

i have a problem with Alpha channel..
for now i understand Per-pixel Alpha value and Per-surface Alpha values..
so if i make transparent background png file, that would be "Per-pixel 
alpha" 
surface, so i cant adjust "Per-surface" alpha with "SDL_SetAlpha" function.
there was a great function set Per-pixel alpha value which posted this 
mailing list by Plus II.. thanks!
but it worked a fresh loaded png files, but when i try to give whole screen
alpha value, i cant make it.

i tried :

void Darken_Screen(SDL_Surface *main_screen,int alpha)
{
    Set_Per_Pixel_Alpha(main_screen,128); //which got from mailing list
    SDL_Flip(main_screen);
}

it failed, and i tried :

void Darken_Screen(SDL_Surface *main_screen,int alpha)
{
    SDL_Surface *temp_screen;
    
    temp_screen = 
        SDL_ConvertSurface(main_screen,main_screen->format,SDL_HWSURFACE);
    Set_Per_Pixel_Alpha(temp,128);
    SDL_BlitSurface(temp,NULL,main_screen,NULL);
    SDL_Flip(main_screen);
}

it failed, either.
please let me know what am i doing wrong.. thank you.

_________________________________________________________________
MSN Explorer가 있으면 Hotmail 사용이 훨씬 편리해 집니다.<br>지금 
http://explorer.msn.co.kr/에서 무료로 다운로드하세요.





More information about the SDL mailing list