aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_x11_gl.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-06-27 21:15:57 +0200
committerDavid Robillard <d@drobilla.net>2019-06-27 22:08:30 +0200
commit3d535a3f299e4bc20787032de718b0198ae53bae (patch)
treeddda4a4ab4c92ad1320e7ed7526cf6d86a417cf7 /pugl/pugl_x11_gl.c
parenta522c769e3279861c45093edf6acfe1aafc1035f (diff)
downloadpugl-3d535a3f299e4bc20787032de718b0198ae53bae.tar.gz
pugl-3d535a3f299e4bc20787032de718b0198ae53bae.tar.bz2
pugl-3d535a3f299e4bc20787032de718b0198ae53bae.zip
Fix double-buffering
Diffstat (limited to 'pugl/pugl_x11_gl.c')
-rw-r--r--pugl/pugl_x11_gl.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/pugl/pugl_x11_gl.c b/pugl/pugl_x11_gl.c
index b1399cc..8f8e4fd 100644
--- a/pugl/pugl_x11_gl.c
+++ b/pugl/pugl_x11_gl.c
@@ -69,9 +69,7 @@ puglX11GlConfigure(PuglView* view)
GLX_ALPHA_SIZE, puglX11GlHintValue(view->hints.alpha_bits),
GLX_DEPTH_SIZE, puglX11GlHintValue(view->hints.depth_bits),
GLX_STENCIL_SIZE, puglX11GlHintValue(view->hints.stencil_bits),
- GLX_DOUBLEBUFFER, (view->hints.samples
- ? GLX_DONT_CARE
- : view->hints.double_buffer),
+ GLX_DOUBLEBUFFER, puglX11GlHintValue(view->hints.double_buffer),
None
};
@@ -162,14 +160,13 @@ puglX11GlLeave(PuglView* view, bool flush)
{
PuglX11GlSurface* surface = (PuglX11GlSurface*)view->impl->surface;
- if (flush) {
+ if (flush && surface->double_buffered) {
+ glXSwapBuffers(view->impl->display, view->impl->win);
+ } else if (flush) {
glFlush();
}
glXMakeCurrent(view->impl->display, None, NULL);
- if (surface->double_buffered) {
- glXSwapBuffers(view->impl->display, view->impl->win);
- }
return 0;
}