mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08: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 {
|
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)
|
c.UseProgram(programTexture)
|
||||||
lastProgram = programTexture
|
lastProgram = programTexture
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ type Texture int
|
|||||||
type Framebuffer int
|
type Framebuffer int
|
||||||
type Shader int
|
type Shader int
|
||||||
type Program 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 UniformLocation gl.UniformLocation
|
||||||
type AttribLocation gl.AttribLocation
|
type AttribLocation gl.AttribLocation
|
||||||
|
|
||||||
|
@ -39,6 +39,11 @@ type Program struct {
|
|||||||
js.Object
|
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 {
|
type UniformLocation struct {
|
||||||
js.Object
|
js.Object
|
||||||
}
|
}
|
||||||
@ -151,7 +156,8 @@ var lastFramebuffer Framebuffer
|
|||||||
|
|
||||||
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
|
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
|
||||||
gl := c.gl
|
gl := c.gl
|
||||||
if lastFramebuffer != f {
|
// TODO: Fix this after the GopherJS bug was fixed (#159)
|
||||||
|
if lastFramebuffer.Object != f.Object {
|
||||||
gl.Flush()
|
gl.Flush()
|
||||||
lastFramebuffer = f
|
lastFramebuffer = f
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user