opengl: Should access the prototype of WebGLRenderingContext on Safari (#293)

This commit is contained in:
Hajime Hoshi 2016-11-26 01:17:22 +09:00
parent 3e2f2e9f08
commit 74c552ea6c

View File

@ -62,7 +62,8 @@ func (p Program) id() programID {
} }
func init() { func init() {
c := js.Global.Get("WebGLRenderingContext") // Accessing the prototype is rquired on Safari.
c := js.Global.Get("WebGLRenderingContext").Get("prototype")
Nearest = Filter(c.Get("NEAREST").Int()) Nearest = Filter(c.Get("NEAREST").Int())
Linear = Filter(c.Get("LINEAR").Int()) Linear = Filter(c.Get("LINEAR").Int())
VertexShader = ShaderType(c.Get("VERTEX_SHADER").Int()) VertexShader = ShaderType(c.Get("VERTEX_SHADER").Int())