[SDL] Using SDL_DisplayYUVOverlay and SDL_BlitSurface/SDL_UpdateRects together.

Martin Havn 03827 at iha.dk
Mon Nov 20 07:59:41 PST 2006


I'm trying to create a custom OSD menu for a mediaplayer.

The Idea is to display a menu in the middle of the video window, with
the video rolling in the background.

Is there Multiple layers I can draw on so I don't have to care about vid
fps (without drawing the menu on every frame)?

I would like to just draw the OSD Menu once, and then just update when I
select or navigate in it. 

 

Ive tried 3 methods:

 

1: The video is blit to the screen with SDL_DisplayYUVOverlay.

What I tried to do first was simply SDL_BlitSurface and SDL_UpdateRects
to put the menu bmp onto the screen.

This got the desired effect, of menu front and vid rolling in the back.

But when I want to quit the menu, the video will never update in the
area where I used update rect. How can I fix this?

 

2: Ive also tried using double buffering and SDL_Flip. But then the
video wont even show, ill just get my OSD and black background. 

Why is SDL_flip (I just call it once to show the menu), prohibiting the
SDL_DisplayYUVOverlay from displaying anything?

 

3: Then I tried to tie my SDL_Overlay to a secondary surface. Use
SDL_DisplayYUVOverlay to blit it onto. 

Then blit the vid frame and the OSD to the screen with SDL_BlitSurface
and then SDL_Flip.

This resulted in horrible vid performance.

 

The solution I had for method 1, but having tried yet:

When I close my OSD Menu, I need to recreate the screen (free surface +
setvideomode), and create the overlay again with this new screen tied.

This way the SDL_DisplayYUVOverlay, will successfully draw the video
after the menu. But will create an image skip I would guess.

 

Best Regards

Martin Havn.

---
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20061120/737407e8/attachment.htm 


More information about the SDL mailing list