This commit is contained in:
DBotThePony 2022-09-11 01:21:33 +07:00
parent 194a7e479c
commit 9bbff0403a
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 3 additions and 3 deletions

View File

@ -5,11 +5,11 @@ import ru.dbotthepony.kstarbound.client.gl.GLAttributeList
import ru.dbotthepony.kstarbound.client.gl.GLVertexBufferObject
import ru.dbotthepony.kstarbound.util.ByteBufferOutputStream
open class DirectVertexBuilder(
open class DirectVertexBuilder<T : DirectVertexBuilder<T>>(
attributes: GLAttributeList,
type: VertexType,
val maxElements: Int,
) : AbstractVertexBuilder<HeapVertexBuilder>(attributes, type) {
) : AbstractVertexBuilder<DirectVertexBuilder<T>>(attributes, type) {
val maxIndexCount = maxElements * type.indicies.size
val maxVertexCount = maxElements * type.elements

View File

@ -14,7 +14,7 @@ class StreamVertexBuilder(
attributes: GLAttributeList,
type: VertexType,
maxElements: Int,
) : DirectVertexBuilder(attributes, type, maxElements), Closeable {
) : DirectVertexBuilder<StreamVertexBuilder>(attributes, type, maxElements), Closeable {
private val vao = state.newVAO()
private val vbo = state.newVBO()
private val ebo = state.newEBO()