DGA and SMPEG

Hello,
So, Now I have started to finally use DGA, and it definitely seems to
be running smoother, 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
seems to defeat the purpose of double buffering. However, this was the
only way I was able to get my animations from flashing.

If this is the case, then How can I setup a static background for a
playing SMPEG.

I guess I just need some help on how to use Double Buffering correctly
with SDL_BlitSurface.

Thank you,
Robert

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.

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?
RobertOn 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

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

Why is that? Blit background to first buffer, flip, blit
background to second buffer. Now you won’t need to blit
backgrounds again (if you blit the mpeg in very same place).On 17 Jan 2003, Robert Diel wrote:

regards,
Pallav.


If I were a grave-digger or even a hangman, there are some people I could
work for with a great deal of enjoyment.
– Douglas Jerrold


| |
|Pallav Nawani |
|Sasken Communication Technologies Ltd. |
|Domlur, Bangalore. |
|_______________________________________________________________|