mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
Refactoring (use math.MaxUint16)
This commit is contained in:
parent
58e2f27513
commit
efe7b62745
@ -29,8 +29,8 @@ var (
|
|||||||
programSolid opengl.Program
|
programSolid opengl.Program
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: Use math.MaxUint16??
|
const indicesNum = math.MaxUint16 + 1
|
||||||
const quadsMaxNum = 65536 / 6
|
const quadsMaxNum = indicesNum / 6
|
||||||
|
|
||||||
// unsafe.SizeOf can't be used because unsafe doesn't work with GopherJS.
|
// unsafe.SizeOf can't be used because unsafe doesn't work with GopherJS.
|
||||||
const int16Size = 2
|
const int16Size = 2
|
||||||
@ -90,10 +90,9 @@ func initialize(c *opengl.Context) error {
|
|||||||
}
|
}
|
||||||
indexBufferQuads = c.NewBuffer(c.ElementArrayBuffer, indices, c.StaticDraw)
|
indexBufferQuads = c.NewBuffer(c.ElementArrayBuffer, indices, c.StaticDraw)
|
||||||
|
|
||||||
// TODO: Use math.MaxUint16
|
indices = make([]uint16, indicesNum)
|
||||||
indices = make([]uint16, 65536)
|
for i := 0; i < len(indices); i++ {
|
||||||
for i := uint16(0); i < math.MaxUint16; i++ {
|
indices[i] = uint16(i)
|
||||||
indices[i] = i
|
|
||||||
}
|
}
|
||||||
indexBufferLines = c.NewBuffer(c.ElementArrayBuffer, indices, c.StaticDraw)
|
indexBufferLines = c.NewBuffer(c.ElementArrayBuffer, indices, c.StaticDraw)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user