From 6d46d9d554fe7189557825787dd920200b87ca80 Mon Sep 17 00:00:00 2001 From: Thomas Friedel Date: Thu, 18 Apr 2019 14:46:20 +0200 Subject: [PATCH] removed the clipping reapplication after context switching since it didn't work properly --- backend/gogl/clip.go | 3 --- backend/gogl/gogl.go | 8 +------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/backend/gogl/clip.go b/backend/gogl/clip.go index f90558a..7da6254 100644 --- a/backend/gogl/clip.go +++ b/backend/gogl/clip.go @@ -7,7 +7,6 @@ import ( ) func (b *GoGLBackend) ClearClip() { - b.curClip = nil b.activate() gl.StencilMask(0xFF) @@ -15,9 +14,7 @@ func (b *GoGLBackend) ClearClip() { } func (b *GoGLBackend) Clip(pts [][2]float64) { - b.curClip = nil b.activate() - b.curClip = pts b.ptsBuf = b.ptsBuf[:0] b.ptsBuf = append(b.ptsBuf, diff --git a/backend/gogl/gogl.go b/backend/gogl/gogl.go index 53ea60d..981452b 100644 --- a/backend/gogl/gogl.go +++ b/backend/gogl/gogl.go @@ -206,8 +206,6 @@ type GoGLBackend struct { *GLContext - curClip [][2]float64 - activateFn func() disableTextureRenderTarget func() } @@ -246,11 +244,7 @@ func New(x, y, w, h int, ctx *GLContext) (*GoGLBackend, error) { b.activateFn = func() { gl.BindFramebuffer(gl.FRAMEBUFFER, 0) gl.Viewport(int32(b.x), int32(b.y), int32(b.w), int32(b.h)) - gl.Clear(gl.STENCIL_BUFFER_BIT) - if c := b.curClip; c != nil { - b.curClip = nil - b.Clip(c) - } + // todo reapply clipping since another application may have used the stencil buffer } b.disableTextureRenderTarget = func() { gl.BindFramebuffer(gl.FRAMEBUFFER, 0)