aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
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
parenta522c769e3279861c45093edf6acfe1aafc1035f (diff)
downloadpugl-3d535a3f299e4bc20787032de718b0198ae53bae.tar.gz
pugl-3d535a3f299e4bc20787032de718b0198ae53bae.tar.bz2
pugl-3d535a3f299e4bc20787032de718b0198ae53bae.zip
Fix double-buffering
Diffstat (limited to 'pugl')
-rw-r--r--pugl/pugl_internal_types.h2
-rw-r--r--pugl/pugl_x11_gl.c11
2 files changed, 5 insertions, 8 deletions
diff --git a/pugl/pugl_internal_types.h b/pugl/pugl_internal_types.h
index bbc39c0..839084c 100644
--- a/pugl/pugl_internal_types.h
+++ b/pugl/pugl_internal_types.h
@@ -39,8 +39,8 @@ typedef struct {
int depth_bits;
int stencil_bits;
int samples;
+ int double_buffer;
bool use_compat_profile;
- bool double_buffer;
bool resizable;
} PuglHints;
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;
}