Skip to content

Commit b40b1ae

Browse files
committed
Smol refac
1 parent de3bb6e commit b40b1ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/src/main/kotlin/com/lambda/graphics/buffer/pbo/PixelBuffer.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class PixelBuffer(
2626
private var uploadIdx = 0 // Used to upload data to the PBO
2727

2828
private val queryId = glGenQueries() // Used to measure the time taken to upload data to the PBO
29-
private val uploadTime get() = IntArray(1).also { glGetQueryObjectiv(queryId, GL_QUERY_RESULT, it) }[0]
29+
private val uploadTime get() =
30+
IntArray(1).also { glGetQueryObjectiv(queryId, GL_QUERY_RESULT, it) }.first()
3031
private var transferRate = 0L // The transfer rate in bytes per second
3132

3233
private val pboSupported = GL.getCapabilities().OpenGL30 || GL.getCapabilities().GL_ARB_pixel_buffer_object
@@ -60,8 +61,7 @@ class PixelBuffer(
6061

6162
// Perform the actual data transfer to the GPU
6263
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0)
63-
}
64-
else {
64+
} else {
6565
// Perform the actual data transfer to the GPU
6666
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer)
6767
}

0 commit comments

Comments
 (0)