Page 1 of 1

using of two buffers instead of one in firework example?

PostPosted: Nov 12, 2006 @ 6:33pm
by Bunkai
Hello,

After what I downloaded PocketHAL 0.7.7 evaluation version, I decided to analyze examples to understand how the library works. Therefore, I looked at Firework example.

I noticed tha the firework is firsty drawn into m_buffer2 buffer, which is at one moment coppied to backbuffer returned by display->GetBackBuffer(), and this is then swapped via display->Swap(); to video RAM.

In other words, instead of using one buffer that would be flipped to the video ram, there is a second buffer used.

Is this approach somehow beneficial to PocketHAL? Logic says to me, that it is most likely a waste of computer resources. I understand the need of one buffer that is coppied to VRAM once, to avoid delays from waiting to vsync, but what that second buffer is good for?

Is is a technique I've read about, called DoubleBuffering?

Thank you,
with Regards,
Rene.

PostPosted: Nov 12, 2006 @ 9:12pm
by fast_rx

PostPosted: Nov 12, 2006 @ 10:50pm
by Bunkai

PostPosted: Nov 13, 2006 @ 12:22am
by fast_rx

PostPosted: Nov 13, 2006 @ 9:42am
by Bunkai
FastRX,
Thank you. Now I am sure what double-buffering is about.

With regards,
Rene