Skip to content

Commit fc67ccf

Browse files
committed
fixed float/int bufferOf
1 parent 6db5c29 commit fc67ccf

File tree

1 file changed

+2
-2
lines changed
  • src/main/kotlin/uno/buffer

1 file changed

+2
-2
lines changed

src/main/kotlin/uno/buffer/of.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fun floatBufferOf(vertices: Collection<*>): FloatBuffer {
201201
is Float -> {
202202
res = floatBufferBig(vertices.size)
203203
for (i in 0 until vertices.size)
204-
res.put(i * Float.BYTES, (vertices.elementAt(i) as Float))
204+
res.put(i, (vertices.elementAt(i) as Float))
205205
}
206206
is Vec2 -> {
207207
res = floatBufferBig(Vec2.length * vertices.size)
@@ -229,7 +229,7 @@ fun intBufferOf(vertices: Collection<*>): IntBuffer {
229229
is Int -> {
230230
res = intBufferBig(vertices.size)
231231
for (i in 0 until vertices.size)
232-
res.put(i * Int.BYTES, (vertices.elementAt(i) as Int))
232+
res.put(i, (vertices.elementAt(i) as Int))
233233
}
234234
is Vec2i -> {
235235
res = intBufferBig(Vec2i.length * vertices.size)

0 commit comments

Comments
 (0)