Double buffering question

is it possible to only double buffer a part of a surface? like if you have
an sdl_surface that is the main background, but then have a second smaller
sdl_surface that is doublebuffered? and if so, is this worth the effort? is
it/would it be just as fast to use only one surface… would the second
actually slow things down?

–Keith

is it possible to only double buffer a part of a surface?

No, and Yes. There is no built in support for doing what you want. But,
you can render into one buffer, and then blit it to part of another
buffer. The result looks like what you want. BUT, you may not have
hardware blit support, so the copying could be slow. And, you may not
have hardware support for the second buffer, so rendering could be slow.

The easy way to do it is to render the non-animated stuff into both the
front and back buffers and render the animated stuff into a rectangle in
the buffers. As long as you keep the non-animated stuff synchronized
between both buffers it looks just like an animating window set in a
non-animating background.

	Bob PendletonOn Wed, 2003-04-02 at 13:33, Keith Swyer wrote:

like if you have
an sdl_surface that is the main background, but then have a second smaller
sdl_surface that is doublebuffered? and if so, is this worth the effort? is
it/would it be just as fast to use only one surface… would the second
actually slow things down?

–Keith


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+