mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
graphicsdriver/opengl: Remove init order dependency
This commit is contained in:
parent
f1c87ac373
commit
de788603d6
@ -69,8 +69,6 @@ func init() {
|
|||||||
dstAlpha = gl.DST_ALPHA
|
dstAlpha = gl.DST_ALPHA
|
||||||
oneMinusSrcAlpha = gl.ONE_MINUS_SRC_ALPHA
|
oneMinusSrcAlpha = gl.ONE_MINUS_SRC_ALPHA
|
||||||
oneMinusDstAlpha = gl.ONE_MINUS_DST_ALPHA
|
oneMinusDstAlpha = gl.ONE_MINUS_DST_ALPHA
|
||||||
|
|
||||||
initializeArrayBuferLayout()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type contextImpl struct {
|
type contextImpl struct {
|
||||||
|
@ -109,8 +109,6 @@ func init() {
|
|||||||
unpackAlignment = c.Get("UNPACK_ALIGNMENT")
|
unpackAlignment = c.Get("UNPACK_ALIGNMENT")
|
||||||
unsignedByte = c.Get("UNSIGNED_BYTE")
|
unsignedByte = c.Get("UNSIGNED_BYTE")
|
||||||
unsignedShort = c.Get("UNSIGNED_SHORT")
|
unsignedShort = c.Get("UNSIGNED_SHORT")
|
||||||
|
|
||||||
initializeArrayBuferLayout()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type contextImpl struct {
|
type contextImpl struct {
|
||||||
|
@ -66,8 +66,6 @@ func init() {
|
|||||||
dstAlpha = mgl.DST_ALPHA
|
dstAlpha = mgl.DST_ALPHA
|
||||||
oneMinusSrcAlpha = mgl.ONE_MINUS_SRC_ALPHA
|
oneMinusSrcAlpha = mgl.ONE_MINUS_SRC_ALPHA
|
||||||
oneMinusDstAlpha = mgl.ONE_MINUS_DST_ALPHA
|
oneMinusDstAlpha = mgl.ONE_MINUS_DST_ALPHA
|
||||||
|
|
||||||
initializeArrayBuferLayout()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type contextImpl struct {
|
type contextImpl struct {
|
||||||
|
@ -78,30 +78,26 @@ func (a *arrayBufferLayout) disable(context *context, program program) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// theArrayBufferLayout is the array buffer layout for Ebiten.
|
// theArrayBufferLayout is the array buffer layout for Ebiten.
|
||||||
var theArrayBufferLayout arrayBufferLayout
|
var theArrayBufferLayout = arrayBufferLayout{
|
||||||
|
// Note that GL_MAX_VERTEX_ATTRIBS is at least 16.
|
||||||
func initializeArrayBuferLayout() {
|
parts: []arrayBufferLayoutPart{
|
||||||
theArrayBufferLayout = arrayBufferLayout{
|
{
|
||||||
// Note that GL_MAX_VERTEX_ATTRIBS is at least 16.
|
name: "vertex",
|
||||||
parts: []arrayBufferLayoutPart{
|
num: 2,
|
||||||
{
|
|
||||||
name: "vertex",
|
|
||||||
num: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "tex",
|
|
||||||
num: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "tex_region",
|
|
||||||
num: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "color_scale",
|
|
||||||
num: 4,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
{
|
||||||
|
name: "tex",
|
||||||
|
num: 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "tex_region",
|
||||||
|
num: 4,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "color_scale",
|
||||||
|
num: 4,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
Loading…
Reference in New Issue
Block a user