removed the clipping reapplication after context switching since it didn't work properly
This commit is contained in:
parent
ff4c73b6b7
commit
6d46d9d554
2 changed files with 1 additions and 10 deletions
|
@ -7,7 +7,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b *GoGLBackend) ClearClip() {
|
func (b *GoGLBackend) ClearClip() {
|
||||||
b.curClip = nil
|
|
||||||
b.activate()
|
b.activate()
|
||||||
|
|
||||||
gl.StencilMask(0xFF)
|
gl.StencilMask(0xFF)
|
||||||
|
@ -15,9 +14,7 @@ func (b *GoGLBackend) ClearClip() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *GoGLBackend) Clip(pts [][2]float64) {
|
func (b *GoGLBackend) Clip(pts [][2]float64) {
|
||||||
b.curClip = nil
|
|
||||||
b.activate()
|
b.activate()
|
||||||
b.curClip = pts
|
|
||||||
|
|
||||||
b.ptsBuf = b.ptsBuf[:0]
|
b.ptsBuf = b.ptsBuf[:0]
|
||||||
b.ptsBuf = append(b.ptsBuf,
|
b.ptsBuf = append(b.ptsBuf,
|
||||||
|
|
|
@ -206,8 +206,6 @@ type GoGLBackend struct {
|
||||||
|
|
||||||
*GLContext
|
*GLContext
|
||||||
|
|
||||||
curClip [][2]float64
|
|
||||||
|
|
||||||
activateFn func()
|
activateFn func()
|
||||||
disableTextureRenderTarget func()
|
disableTextureRenderTarget func()
|
||||||
}
|
}
|
||||||
|
@ -246,11 +244,7 @@ func New(x, y, w, h int, ctx *GLContext) (*GoGLBackend, error) {
|
||||||
b.activateFn = func() {
|
b.activateFn = func() {
|
||||||
gl.BindFramebuffer(gl.FRAMEBUFFER, 0)
|
gl.BindFramebuffer(gl.FRAMEBUFFER, 0)
|
||||||
gl.Viewport(int32(b.x), int32(b.y), int32(b.w), int32(b.h))
|
gl.Viewport(int32(b.x), int32(b.y), int32(b.w), int32(b.h))
|
||||||
gl.Clear(gl.STENCIL_BUFFER_BIT)
|
// todo reapply clipping since another application may have used the stencil buffer
|
||||||
if c := b.curClip; c != nil {
|
|
||||||
b.curClip = nil
|
|
||||||
b.Clip(c)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
b.disableTextureRenderTarget = func() {
|
b.disableTextureRenderTarget = func() {
|
||||||
gl.BindFramebuffer(gl.FRAMEBUFFER, 0)
|
gl.BindFramebuffer(gl.FRAMEBUFFER, 0)
|
||||||
|
|
Loading…
Reference in a new issue