Skip to content

Commit

Permalink
Fix GLES crash when clearing the framebuffer (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf authored Jul 6, 2024
1 parent 6988eff commit 230e100
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arcade/gl/framebuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ def clear(
gl.glClearColor(*clear_color)

if self.depth_attachment:
gl.glClearDepth(depth)
if self._ctx.gl_api == "gl":
gl.glClearDepth(depth)
else: # gles only supports glClearDepthf
gl.glClearDepthf(depth)

gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)
else:
gl.glClear(gl.GL_COLOR_BUFFER_BIT)
Expand Down

0 comments on commit 230e100

Please sign in to comment.