opengl: Define Texture/Framebuffer Equals for JS performance

This commit is contained in:
Hajime Hoshi
2017-07-02 22:18:49 +09:00
parent 3a3a4af035
commit 26a83c0e00
4 changed files with 29 additions and 2 deletions

View File

@@ -24,6 +24,9 @@ import (
"github.com/gopherjs/webgl"
)
// Note that `type Texture *js.Object` doesn't work.
// There is no way to get the internal object in that case.
type Texture struct {
*js.Object
}
@@ -44,6 +47,14 @@ type Buffer struct {
*js.Object
}
func (t Texture) equals(other Texture) bool {
return t.Object == other.Object
}
func (f Framebuffer) equals(other Framebuffer) bool {
return f.Object == other.Object
}
type uniformLocation struct {
*js.Object
}