mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
graphics: Refactoring
This commit is contained in:
parent
03e3f0f5f7
commit
25f2dfc677
@ -55,7 +55,7 @@ func (a *arrayBufferLayout) totalBytes() int {
|
||||
|
||||
// newArrayBuffer creates OpenGL's buffer object for the array buffer.
|
||||
func (a *arrayBufferLayout) newArrayBuffer() opengl.Buffer {
|
||||
return opengl.GetContext().NewArrayBuffer(a.totalBytes() * 4 * maxQuads)
|
||||
return opengl.GetContext().NewArrayBuffer(a.totalBytes() * indicesNum)
|
||||
}
|
||||
|
||||
// enable binds the array buffer the given program to use the array buffer.
|
||||
@ -131,8 +131,9 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
indicesNum = 1 << 16
|
||||
maxQuads = indicesNum / 6
|
||||
indicesNum = 1 << 16
|
||||
maxTriangles = indicesNum / 3
|
||||
maxQuads = maxTriangles / 2
|
||||
)
|
||||
|
||||
// ResetGLState resets or initializes the current OpenGL state.
|
||||
|
Loading…
Reference in New Issue
Block a user