From ebe62962222c02a5ee6f1b0422dca64ad0688d2b Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 15 May 2016 02:37:25 +0900 Subject: [PATCH] opengl: Remove (*Program).Equals --- internal/graphics/opengl/context_desktop.go | 5 ----- internal/graphics/opengl/context_js.go | 5 ----- internal/graphics/opengl/context_mobile.go | 5 ----- internal/graphics/program.go | 2 +- 4 files changed, 1 insertion(+), 16 deletions(-) diff --git a/internal/graphics/opengl/context_desktop.go b/internal/graphics/opengl/context_desktop.go index 6fd8d1a08..54355513b 100644 --- a/internal/graphics/opengl/context_desktop.go +++ b/internal/graphics/opengl/context_desktop.go @@ -32,11 +32,6 @@ type Buffer uint32 var ZeroFramebuffer Framebuffer -// TODO: Remove this after the GopherJS bug was fixed (#159) -func (p Program) Equals(other Program) bool { - return p == other -} - type uniformLocation int32 type attribLocation int32 diff --git a/internal/graphics/opengl/context_js.go b/internal/graphics/opengl/context_js.go index 2aa1c1247..3dafe698a 100644 --- a/internal/graphics/opengl/context_js.go +++ b/internal/graphics/opengl/context_js.go @@ -45,11 +45,6 @@ type Buffer struct { *js.Object } -// TODO: Remove this after the GopherJS bug was fixed (#159) -func (p Program) Equals(other Program) bool { - return p.Object == other.Object -} - type uniformLocation struct { *js.Object } diff --git a/internal/graphics/opengl/context_mobile.go b/internal/graphics/opengl/context_mobile.go index b7ae28667..3e9af0b76 100644 --- a/internal/graphics/opengl/context_mobile.go +++ b/internal/graphics/opengl/context_mobile.go @@ -31,11 +31,6 @@ type Buffer mgl.Buffer var ZeroFramebuffer Framebuffer -// TODO: Remove this after the GopherJS bug was fixed (#159) -func (p Program) Equals(other Program) bool { - return p == other -} - type uniformLocation mgl.Uniform type attribLocation mgl.Attrib diff --git a/internal/graphics/program.go b/internal/graphics/program.go index 977ba5fc9..4bdb61af0 100644 --- a/internal/graphics/program.go +++ b/internal/graphics/program.go @@ -112,7 +112,7 @@ type programContext struct { func (p *programContext) begin() { c := p.context - if !p.state.lastProgram.Equals(p.program) { + if p.state.lastProgram != p.program { c.UseProgram(p.program) p.state.lastProgram = p.state.programTexture p.state.lastProjectionMatrix = nil