mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-10-25 17:10:25 +08:00
opengl: Define Texture/Framebuffer Equals for JS performance
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user