[SDL] Problem with some SDL_Overlay sizes.

Artem Baguinski artm at v2.nl
Tue Oct 17 07:00:04 PDT 2006


On 17 Oct 2006, at 14:17, Vassili A akimov wrote:

> 		Hello!
> 	My name is Vassili Akimov, I try to develop some program, which  
> utilize SDL.
> I need to create some number of SDL_Overlays ( software overlays ) and
> display them on the main surface. I found, that some x sizes,  
> provided to
> SDL_CreateYUVOverlay, results "wrong" overlay, which being  
> displayed, shows
> only part of the pixels it should.
> For example if I try to create the software overlay 23x23 pixels, I  
> get some
> overlay, wich shows only part of the pixels, I provide to it. To  
> illustrate
> the problem, I made simple program, which creates SDL surface, than  
> creates
> RGB surface 23x23 pixels. Than fill rgb surface with vertical rgb  
> stripes one
> pixel wide. Than I create 10 overlays 23x23 convert rgb surface  
> data into
> yv12 and fill overlay with this data, and display the overlays on main
> surface.

> As the result, stripes occured to be diagonal, and only part to  
> destination
> rectangle is displayed. If I change the overlay size to 22 pixels ( x
> -direction ), everything turnes out correct. Can anyone help me  
> with this
> situation?
>

You can't have "nice" arbitrary size YV12 overlays because of  
subsampling: number of values stored for chroma components is 1/4 of  
number of pixels, so you want your overlays have even sizes (e.g.  
24x24 or 22x22)

I'm not sure what goes on when you request incompatible sizes, i  
would say "behaviour is unspecified" ;-)






More information about the SDL mailing list