diff --git a/internal/graphicsdriver/opengl/context_desktop.go b/internal/graphicsdriver/opengl/context_desktop.go index f1a7bb726..2d70e0c6e 100644 --- a/internal/graphicsdriver/opengl/context_desktop.go +++ b/internal/graphicsdriver/opengl/context_desktop.go @@ -69,8 +69,6 @@ func init() { dstAlpha = gl.DST_ALPHA oneMinusSrcAlpha = gl.ONE_MINUS_SRC_ALPHA oneMinusDstAlpha = gl.ONE_MINUS_DST_ALPHA - - initializeArrayBuferLayout() } type contextImpl struct { diff --git a/internal/graphicsdriver/opengl/context_js.go b/internal/graphicsdriver/opengl/context_js.go index 38ee0c571..ee1266c33 100644 --- a/internal/graphicsdriver/opengl/context_js.go +++ b/internal/graphicsdriver/opengl/context_js.go @@ -109,8 +109,6 @@ func init() { unpackAlignment = c.Get("UNPACK_ALIGNMENT") unsignedByte = c.Get("UNSIGNED_BYTE") unsignedShort = c.Get("UNSIGNED_SHORT") - - initializeArrayBuferLayout() } type contextImpl struct { diff --git a/internal/graphicsdriver/opengl/context_mobile.go b/internal/graphicsdriver/opengl/context_mobile.go index f486b1c64..7fa6afdb2 100644 --- a/internal/graphicsdriver/opengl/context_mobile.go +++ b/internal/graphicsdriver/opengl/context_mobile.go @@ -66,8 +66,6 @@ func init() { dstAlpha = mgl.DST_ALPHA oneMinusSrcAlpha = mgl.ONE_MINUS_SRC_ALPHA oneMinusDstAlpha = mgl.ONE_MINUS_DST_ALPHA - - initializeArrayBuferLayout() } type contextImpl struct { diff --git a/internal/graphicsdriver/opengl/program.go b/internal/graphicsdriver/opengl/program.go index 2dce346a8..8528a60cf 100644 --- a/internal/graphicsdriver/opengl/program.go +++ b/internal/graphicsdriver/opengl/program.go @@ -78,30 +78,26 @@ func (a *arrayBufferLayout) disable(context *context, program program) { } // theArrayBufferLayout is the array buffer layout for Ebiten. -var theArrayBufferLayout arrayBufferLayout - -func initializeArrayBuferLayout() { - theArrayBufferLayout = arrayBufferLayout{ - // Note that GL_MAX_VERTEX_ATTRIBS is at least 16. - parts: []arrayBufferLayoutPart{ - { - name: "vertex", - num: 2, - }, - { - name: "tex", - num: 2, - }, - { - name: "tex_region", - num: 4, - }, - { - name: "color_scale", - num: 4, - }, +var theArrayBufferLayout = arrayBufferLayout{ + // Note that GL_MAX_VERTEX_ATTRIBS is at least 16. + parts: []arrayBufferLayoutPart{ + { + name: "vertex", + num: 2, }, - } + { + name: "tex", + num: 2, + }, + { + name: "tex_region", + num: 4, + }, + { + name: "color_scale", + num: 4, + }, + }, } func init() {