From 63d537db0e2c96f34aeefd932187fcbdc0322fac Mon Sep 17 00:00:00 2001 From: Jonathan Hogg Date: Wed, 18 Sep 2024 13:07:51 +0100 Subject: [PATCH] Finish the OpenGL context for offscreen windows This fixes a weird rendering bug that only seems to affect macOS, where textures rendered in an offscreen can contain the wrong data. --- src/flitter/render/window/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flitter/render/window/__init__.py b/src/flitter/render/window/__init__.py index 005b4ba1..12e0acf5 100644 --- a/src/flitter/render/window/__init__.py +++ b/src/flitter/render/window/__init__.py @@ -658,6 +658,8 @@ def render(self, node, references, beat=None, **kwargs): vsync = node.get('vsync', 1, bool, self.default_vsync) glfw.swap_interval(1 if vsync else 0) glfw.swap_buffers(self.window) + else: + self.glctx.finish() self._beat = beat glfw.poll_events() RenderTarget.empty_pool(self.glctx, 1)