performance: rendering: improve memory usage by a lot

This commit is contained in:
Bixilon 2021-02-27 00:45:11 +01:00
parent 38bd37b9f0
commit 18324e0791
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 2 additions and 0 deletions

View File

@ -60,6 +60,7 @@ class ChunkMesh {
glBindVertexArray(vao)
glBindBuffer(GL_ARRAY_BUFFER, vbo)
glBufferData(GL_ARRAY_BUFFER, data.toFloatArray(), GL_STATIC_DRAW)
data.clear() // clear data ((do not store in memory)
var index = 0
glVertexAttribPointer(index, 3, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, 0L)
glEnableVertexAttribArray(index++)

View File

@ -38,6 +38,7 @@ class HUDFontMesh {
glBindVertexArray(vao)
glBindBuffer(GL_ARRAY_BUFFER, vbo)
glBufferData(GL_ARRAY_BUFFER, data.toFloatArray(), GL_STATIC_DRAW)
data.clear() // clear data ((do not store in memory)
var index = 0
glVertexAttribPointer(index, 3, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, 0L)
glEnableVertexAttribArray(index++)