graphicsdriver/opengl: Remove init order dependency

This commit is contained in:
Hajime Hoshi 2018-12-25 23:58:01 +09:00
parent f1c87ac373
commit de788603d6
4 changed files with 19 additions and 29 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -78,10 +78,7 @@ func (a *arrayBufferLayout) disable(context *context, program program) {
}
// theArrayBufferLayout is the array buffer layout for Ebiten.
var theArrayBufferLayout arrayBufferLayout
func initializeArrayBuferLayout() {
theArrayBufferLayout = arrayBufferLayout{
var theArrayBufferLayout = arrayBufferLayout{
// Note that GL_MAX_VERTEX_ATTRIBS is at least 16.
parts: []arrayBufferLayoutPart{
{
@ -101,7 +98,6 @@ func initializeArrayBuferLayout() {
num: 4,
},
},
}
}
func init() {