internal/graphicsdriver/opengl: remove fnGetExtension

This commit is contained in:
Hajime Hoshi 2022-11-17 12:40:02 +09:00
parent bae5aa7732
commit c768860f3f
2 changed files with 4 additions and 5 deletions

View File

@ -49,7 +49,6 @@ type contextImpl struct {
canvas js.Value
webGL2 bool
fnGetExtension js.Value
fnIsContextLost js.Value
}
@ -70,9 +69,6 @@ func (c *context) reset() error {
f := c.ctx.GetInteger(gl.FRAMEBUFFER_BINDING)
c.screenFramebuffer = framebufferNative(f)
if !c.webGL2 {
c.fnGetExtension.Invoke("OES_standard_derivatives")
}
return nil
}

View File

@ -62,9 +62,12 @@ func NewGraphics(canvas js.Value) (graphicsdriver.Graphics, error) {
g.context.canvas = canvas
g.context.ctx = ctx
g.context.webGL2 = webGL2
g.context.fnGetExtension = glContext.Get("getExtension").Call("bind", glContext)
g.context.fnIsContextLost = glContext.Get("isContextLost").Call("bind", glContext)
if !webGL2 {
glContext.Call("getExtension", "OES_standard_derivatives")
}
return g, nil
}