diff --git a/internal/graphicsdriver/opengl/context_js.go b/internal/graphicsdriver/opengl/context_js.go index b65a8d221..0cb553988 100644 --- a/internal/graphicsdriver/opengl/context_js.go +++ b/internal/graphicsdriver/opengl/context_js.go @@ -94,15 +94,9 @@ const ( ) var ( - isWebGL2Available bool + isWebGL2Available = js.Global().Get("WebGL2RenderingContext").Truthy() ) -func init() { - if js.Global().Get("WebGL2RenderingContext").Truthy() { - isWebGL2Available = true - } -} - type contextImpl struct { gl js.Value lastProgramID programID