[SDL] Simple font resize with blend

Riccardo t1t0 at tiscali.it
Tue Jan 28 03:02:02 PST 2003


So, then I guess I need to answer the second question, how do I set up a
background for an SMPEG.  I am currently running at 800x600, and
stretching the mpeg looks horrible.  So, I put a static background
behind it.  This works great with a single buffer, but doesn't work so
well when it's double buffered.  Any suggestions?
Robert

On Fri, 2003-01-17 at 14:32, M. Egmond wrote:
> At 2003-01-17 06:05, you wrote:
> >my only problem now, is that it double buffers, and
> >seemingly this means that the back buffer is filled with black, so every
> >time I want to do things like pull-up an animation on a static
> >background I have to reblit the static background.  Is this correct?
> 
> It is. Since with double buffering you have two buffers, you will have to 
> ensure they both contain the proper graphics.
> 
> However, you can still improve things. You could set up the background, and 
> flip it twice, to make sure both buffers contain the same graphics. Then 
> you can continue your animation without worrying about the background 
> (assuming your animation does not move over the background, in which case 
> you will have to re-do part of your background each image - but you would 
> have to do that with single buffering as well).
> 
> If your background is complicated, you can also consider keeping a separate 
> surface with the background, so you can still blit the background to the 
> backbuffer relatively quickly (or at least quickly blit that part which is 
> needed).
> 
> You should always take care that you know the number of backbuffers 
> accurately though. In case you do triple buffering (I don't think SDL 
> allows this at the moment) you will have to set up three buffers correctly, 
> and take into account the way they rotate (which is more complicated than 
> double buffering since not all 'flips' will result in rotating the three 
> buffers in the same manner...)
> 
> Maarten. 
> 
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl






More information about the SDL mailing list