A computer-graphics technique for updating a dynamic image that greatly reduces the visual artifacts, especially flicker, caused by the screen pixel being changed. The new image is drawn in a "hidden" buffer while the user still sees the old image, stored in a "visible" buffer (hence "double-buffering"). When the new image is fully drawn, the visible and the hidden buffers are switched very quickly and the hidden buffer content becomes visible.
Questions tagged [double-buffering]
163 questions
91
votes
13 answers
Does HTML5/Canvas Support Double Buffering?
What I'd like to do is draw my graphics on a buffer and then be able to copy it as is to the canvas so I can do animation and avoid flickering. But I couldn't find this option. Anyone know how I can go about this?

Shai UI
- 50,568
- 73
- 204
- 309
30
votes
3 answers
Single producer, single consumer data structure with double buffer in C++
I have an application at $work where I have to move between two real-time threads that are scheduled at different frequencies. (The actual scheduling is beyond my control.) The application is hard real-time-ish (one of the threads has to drive a…

user3638506
- 323
- 1
- 3
- 6
11
votes
4 answers
Is it possible to eliminate flickering entirely when resizing a window?
Normally, even when using double buffering, when resizing a window, it seems that it's inevitable that the flickering will happen.
Step 1, the original window.
Step 2, the window is resized, but the extra area hasn't been painted.
Step 3, the…

EFanZh
- 2,357
- 3
- 30
- 63
9
votes
2 answers
What could cause Double Buffering to kill my app?
I have a few custom (winforms) components that draw to the screen using GDI+.
To prevent flickering on repaint, I decided to enable double buffering, so I added a line to my constructor:
public ColourWheel()
{
InitializeComponent();
…

Tom Wright
- 11,278
- 15
- 74
- 148
9
votes
2 answers
What do HWSURFACE and DOUBLEBUF do?
I saw online the use of HWSURFACE|DOUBLEBUF|RESIZABLE to resize the window.
It works but I'm not sure what the HWSURFACE and DOUBLEBUF actually do.
I know it stands for hardware surface and double buffer, but what they actually help with I have no…

MicChe
- 101
- 2
- 10
8
votes
1 answer
Proper double buffering with linux framebuffer
I am wondering how to properly double buffer the framebuffer to avoid tearing. I've done lots of research on this topic and I can't seem to find anything.
I've tried FBIO_WAITFORVSYNC. But per this thread: How to query Vsync phase in Linux it seems…

ktb92677
- 407
- 4
- 16
7
votes
2 answers
Smooth PostScript animations
I would like to run animations in PostScript smoothly. To see what I want, let me switch to PostScript directly. Call ghostscript, and
200 dup scale .5 setgray 0 0 3 3 rectfill
We have now a gray square.
0 setgray 0 1 3 1 rectfill
With a black…

false
- 10,264
- 13
- 101
- 209
7
votes
1 answer
Improve performance of SurfaceView-dervied custom view?
I have written a simple Android application that draws a maze using a custom view derived from SurfaceView. It follows the model of the LunarLander sample application and performs all calculation and drawing using a background thread directly into…

trojanfoe
- 120,358
- 21
- 212
- 242
7
votes
1 answer
Preserving back buffer content after eglSwapBuffers
I'm implementing in Android and native C++ a scene drawing for android using EGL 1.1.
Currently using Android's glSurfaceView - which allows me to draw to a back buffer which is displayed at the end of "onDrawFrame" - when the back buffer and the…

Dror Fichman
- 1,559
- 1
- 14
- 16
7
votes
4 answers
Getting rid of flicker in SWT
We are using a the following class to show a progress-bar in our Java application: TextProgressBar
Unfortunately we are having some problems with flickering when using that (Win 7, Java 7). Do you have any tips on how we can avoid that? Can we…

Yrlec
- 3,401
- 6
- 39
- 75
6
votes
5 answers
Double buffering winAPI
Okay, so in my application, there are a bunch of winAPI and a few custom controls. Yay...
Now, normally, they will just quietly redraw themselves for animations, state changing, ect.... and it all works fine.
But I have a method of class Window…

Alexander Rafferty
- 6,134
- 4
- 33
- 55
6
votes
2 answers
JavaFX Canvas Double Buffering
I am replicating a classic game, Pong, in Java using JavaFX. I am using java.util.Timer, java.util.TimerTask for the game loop and JavaFX's Canvas for rendering. Is there a way to add double buffering to the Canvas so the animation doesn't flicker?…

silex
- 63
- 1
- 6
6
votes
5 answers
Double buffering C#
I'm trying to implement the following method:
void Ball::DrawOn(Graphics g);
The method should draw all previous locations (stored in a queue) of the ball and finally the current location. I don't know if that matters, but I print the previous…

LmSNe
- 143
- 1
- 9
6
votes
1 answer
Double buffering malfunctions ( updated on December 17th 2013 )
INTRODUCTION AND RELEVANT INFORMATION:
I have a complex painting to implement in my main window’s WM_PAINT handler.
I have submitted a picture bellow to illustrate it:
Main window has static controls, instead of buttons, which have style…

AlwaysLearningNewStuff
- 2,939
- 3
- 31
- 84
5
votes
5 answers
Swapping buffers in single-writer-multiple-reader threads
The Story
There is a writer thread, periodically gathering data from somewhere (in real-time, but that doesn't matter much in the question). There are many readers then reading from these data. The usual solution for this is with two reader-writer's…

Shahbaz
- 46,337
- 19
- 116
- 182