Skip to content

Commit 230e100

Browse files
authored
Fix GLES crash when clearing the framebuffer (#2217)
1 parent 6988eff commit 230e100

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arcade/gl/framebuffer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,11 @@ def clear(
398398
gl.glClearColor(*clear_color)
399399

400400
if self.depth_attachment:
401-
gl.glClearDepth(depth)
401+
if self._ctx.gl_api == "gl":
402+
gl.glClearDepth(depth)
403+
else: # gles only supports glClearDepthf
404+
gl.glClearDepthf(depth)
405+
402406
gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)
403407
else:
404408
gl.glClear(gl.GL_COLOR_BUFFER_BIT)

0 commit comments

Comments
 (0)