removed the clipping reapplication after context switching since it didn't work properly

This commit is contained in:
Thomas Friedel 2019-04-18 14:46:20 +02:00
parent ff4c73b6b7
commit 6d46d9d554
2 changed files with 1 additions and 10 deletions

View file

@ -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,

View file

@ -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)