From 44a7690c42b496e5332fa265e0308211c4afde45 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 19 Sep 2020 13:30:57 +0200 Subject: Move puglX11GlEnter() and puglX11GlLeave() above puglX11GlCreate() --- pugl/detail/x11_gl.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'pugl') diff --git a/pugl/detail/x11_gl.c b/pugl/detail/x11_gl.c index f78dbf3..969581b 100644 --- a/pugl/detail/x11_gl.c +++ b/pugl/detail/x11_gl.c @@ -114,6 +114,28 @@ puglX11GlConfigure(PuglView* view) return PUGL_SUCCESS; } +static PuglStatus +puglX11GlEnter(PuglView* view, const PuglEventExpose* PUGL_UNUSED(expose)) +{ + PuglX11GlSurface* surface = (PuglX11GlSurface*)view->impl->surface; + glXMakeCurrent(view->impl->display, view->impl->win, surface->ctx); + return PUGL_SUCCESS; +} + +static PuglStatus +puglX11GlLeave(PuglView* view, const PuglEventExpose* expose) +{ + PuglX11GlSurface* surface = (PuglX11GlSurface*)view->impl->surface; + + if (expose && surface->double_buffered) { + glXSwapBuffers(view->impl->display, view->impl->win); + } + + glXMakeCurrent(view->impl->display, None, NULL); + + return PUGL_SUCCESS; +} + static PuglStatus puglX11GlCreate(PuglView* view) { @@ -176,28 +198,6 @@ puglX11GlDestroy(PuglView* view) return PUGL_SUCCESS; } -static PuglStatus -puglX11GlEnter(PuglView* view, const PuglEventExpose* PUGL_UNUSED(expose)) -{ - PuglX11GlSurface* surface = (PuglX11GlSurface*)view->impl->surface; - glXMakeCurrent(view->impl->display, view->impl->win, surface->ctx); - return PUGL_SUCCESS; -} - -static PuglStatus -puglX11GlLeave(PuglView* view, const PuglEventExpose* expose) -{ - PuglX11GlSurface* surface = (PuglX11GlSurface*)view->impl->surface; - - if (expose && surface->double_buffered) { - glXSwapBuffers(view->impl->display, view->impl->win); - } - - glXMakeCurrent(view->impl->display, None, NULL); - - return PUGL_SUCCESS; -} - PuglGlFunc puglGetProcAddress(const char* name) { -- cgit v1.2.1