The advantage of more than two buffers?

When I draw a Canvas , I use the createBufferStrategy(2) method to create two buffers. However, I have seen many times other people creating three buffers and realizing that many more can be used.

I can understand the need for two buffers, but I cannot understand the logic of using more.

My question is . What is the efficiency of using multiple buffers and how does this affect performance compared to two buffers?

Thanks in advance.

+4
source share
1 answer

With double buffering, the front buffer and reverse buffer are displayed. When the drawing is finished, but before the buffers are turned upside down, no buffer can be affected. This can lead to a waiting period during which the drawing cannot be completed.

Triple buffering is a way to incrementally wait. There are two back buffers: after drawing is completed in one reverse buffer, it can immediately start in another reverse buffer.

Wikipedia has more details .

+5
source

Source: https://habr.com/ru/post/1383474/


All Articles