mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Bug fix: Structs containing js.Object can't be compared (for now)
This commit is contained in:
parent
952f6be822
commit
fe69c04f8f
@ -95,7 +95,7 @@ func (p programFinisher) FinishProgram() {
|
||||
}
|
||||
|
||||
func useProgramTexture(c *opengl.Context, projectionMatrix []float32, texture opengl.Texture, geo Matrix, color Matrix) programFinisher {
|
||||
if lastProgram != programTexture {
|
||||
if !lastProgram.Equals(programTexture) {
|
||||
c.UseProgram(programTexture)
|
||||
lastProgram = programTexture
|
||||
}
|
||||
|
@ -26,6 +26,12 @@ type Texture int
|
||||
type Framebuffer int
|
||||
type Shader int
|
||||
type Program int
|
||||
|
||||
// TODO: Remove this after the GopherJS bug was fixed (#159)
|
||||
func (p Program) Equals(other Program) bool {
|
||||
return p == other
|
||||
}
|
||||
|
||||
type UniformLocation gl.UniformLocation
|
||||
type AttribLocation gl.AttribLocation
|
||||
|
||||
|
@ -39,6 +39,11 @@ type Program 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
|
||||
}
|
||||
@ -151,7 +156,8 @@ var lastFramebuffer Framebuffer
|
||||
|
||||
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
|
||||
gl := c.gl
|
||||
if lastFramebuffer != f {
|
||||
// TODO: Fix this after the GopherJS bug was fixed (#159)
|
||||
if lastFramebuffer.Object != f.Object {
|
||||
gl.Flush()
|
||||
lastFramebuffer = f
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user