From 72f019e7071b4bbb09b71598d7f9f514bf50792e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 3 Oct 2020 19:38:51 +0200 Subject: Store real double buffer value in hint and remove separate variable --- pugl/detail/x11_gl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pugl/detail/x11_gl.c b/pugl/detail/x11_gl.c index f5e6b8d..e4a0ea8 100644 --- a/pugl/detail/x11_gl.c +++ b/pugl/detail/x11_gl.c @@ -37,7 +37,6 @@ typedef struct { GLXFBConfig fb_config; GLXContext ctx; - int double_buffered; } PuglX11GlSurface; static int @@ -125,9 +124,7 @@ puglX11GlEnter(PuglView* view, const PuglEventExpose* PUGL_UNUSED(expose)) static PuglStatus puglX11GlLeave(PuglView* view, const PuglEventExpose* expose) { - PuglX11GlSurface* surface = (PuglX11GlSurface*)view->impl->surface; - - if (expose && surface->double_buffered) { + if (expose && view->hints[PUGL_DOUBLE_BUFFER]) { glXSwapBuffers(view->impl->display, view->impl->win); } @@ -183,7 +180,7 @@ puglX11GlCreate(PuglView* view) glXGetConfig(impl->display, impl->vi, GLX_DOUBLEBUFFER, - &surface->double_buffered); + &view->hints[PUGL_DOUBLE_BUFFER]); return PUGL_SUCCESS; } -- cgit v1.2.1