Make sure FillShaderWrapper works without a window

This commit is contained in:
Grant Sanderson 2023-01-25 14:20:36 -08:00
parent 424707d035
commit 4dfabc1c28

View file

@ -333,10 +333,11 @@ class FillShaderWrapper(ShaderWrapper):
if not winding:
vao.render(moderngl.TRIANGLES)
return
original_fbo = self.ctx.fbo
self.fill_fbo.clear()
self.fill_fbo.use()
self.ctx.blend_func = (moderngl.ONE, moderngl.ONE)
vao.render(self.render_primitive)
self.ctx.blend_func = moderngl.DEFAULT_BLENDING
self.ctx.screen.use()
original_fbo.use()
self.fill_texture_vao.render(moderngl.TRIANGLE_STRIP)