Skip to content

Commit

Permalink
Finish the OpenGL context for offscreen windows
Browse files Browse the repository at this point in the history
This fixes a weird rendering bug that only seems to affect macOS, where 
textures rendered in an offscreen can contain the wrong data.
  • Loading branch information
jonathanhogg committed Sep 18, 2024
1 parent 0349059 commit 63d537d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/flitter/render/window/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 63d537d

Please sign in to comment.