I used yuvoverlay to display my video. and I wanna get
a translucent menu floating on the screen without
stopping video displaying.
Because SDL_DisplayYUVOverlay() will cover the menu
when every new frame is overlayed on the screen ,
I have to call “SDL_BlitSurface” and “SDL_Flip” every
time . So I encounter a fatal problem —speed is
slowed down.
How can get over it ? I have used an alpha of 128,
(50% alpha). It gives no improvement of performance.
somebody have recommended me with opengl. But I dont
wannt turn to that because I have no time to learn
another complete new one.
could SDL provide more fast bliting?
the following is my code:
bmp=SDL_LoadBMP("/root/352x240b.bmp");
SDL_SetAlpha(bmp, SDL_SRCALPHA, 128);
//loop
if (SDL_LockYUVOverlay(overlay)<0) goto err;
overlay->pixels[0]=map;
overlay->pixels[2]=map+(mywidthmyheight);
overlay->pixels[1]=map+(mywidthmyheight)*5/4;
SDL_DisplayYUVOverlay(overlay,&drect);
SDL_UnlockYUVOverlay(overlay);
SDL_BlitSurface(bmp,NULL,screen,&drect);
SDL_Flip(screen);
2 how can I erase the current translucent menu ?
for example , I have put a menu to let my user to
select something from it .
Then after decision of users have been done , I want
to give a new menu to replace the current one.
If I just blit the second menu on the position of the
first menu,
the previous one is still visible because all the
menus has called SDL_SetAlpha .They both are
translucent .
someone give me hints :
save the original video background
–>blit the saved video back to cover the first
translucent menu
–>blit the second translucent menu
It does work, But I still wonder whether other ways is
available because bliting is at the cost of speed.__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup