From c9eb30d66fab2082de79a410576c7353b58819ca Mon Sep 17 00:00:00 2001 From: Zyko <13394516+Zyko0@users.noreply.github.com> Date: Wed, 10 Apr 2024 18:59:21 +0200 Subject: [PATCH] Fixed magic number --- internal/graphicsdriver/opengl/gl/const.go | 1 + internal/graphicsdriver/opengl/graphics.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/graphicsdriver/opengl/gl/const.go b/internal/graphicsdriver/opengl/gl/const.go index def2933fa..517aa9cdb 100644 --- a/internal/graphicsdriver/opengl/gl/const.go +++ b/internal/graphicsdriver/opengl/gl/const.go @@ -23,6 +23,7 @@ const ( BLEND = 0x0BE2 CLAMP_TO_EDGE = 0x812F COLOR_ATTACHMENT0 = 0x8CE0 + COLOR_BUFFER_BIT = 0x4000 COMPILE_STATUS = 0x8B81 DECR_WRAP = 0x8508 DEPTH24_STENCIL8 = 0x88F0 diff --git a/internal/graphicsdriver/opengl/graphics.go b/internal/graphicsdriver/opengl/graphics.go index 8d8d7ec5c..a55a74cae 100644 --- a/internal/graphicsdriver/opengl/graphics.go +++ b/internal/graphicsdriver/opengl/graphics.go @@ -242,7 +242,7 @@ func (g *Graphics) DrawTriangles(dstIDs [graphics.ShaderDstImageCount]graphicsdr // Reset color attachments if s := g.context.ctx.CheckFramebufferStatus(gl.FRAMEBUFFER); s == gl.FRAMEBUFFER_COMPLETE { - g.context.ctx.Clear(16384 | gl.STENCIL_BUFFER_BIT) + g.context.ctx.Clear(gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT) } for i, dst := range dsts { if dst == nil {