specify floatbuffer
This commit is contained in:
parent
2cb2ac16ce
commit
598530c4ec
@ -7,6 +7,7 @@ import ru.dbotthepony.kvector.api.IStruct3f
|
|||||||
import ru.dbotthepony.kvector.api.IStruct4f
|
import ru.dbotthepony.kvector.api.IStruct4f
|
||||||
import java.nio.ByteBuffer
|
import java.nio.ByteBuffer
|
||||||
import java.nio.ByteOrder
|
import java.nio.ByteOrder
|
||||||
|
import java.nio.FloatBuffer
|
||||||
|
|
||||||
class GLUniformLocation(val program: GLShaderProgram, val name: String, val pointer: Int) {
|
class GLUniformLocation(val program: GLShaderProgram, val name: String, val pointer: Int) {
|
||||||
fun set(value: IStruct4f): GLUniformLocation {
|
fun set(value: IStruct4f): GLUniformLocation {
|
||||||
@ -29,8 +30,8 @@ class GLUniformLocation(val program: GLShaderProgram, val name: String, val poin
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
private val buff3x3 by lazy { ByteBuffer.allocateDirect(4 * 3 * 3).also { it.order(ByteOrder.nativeOrder()) }.asFloatBuffer() }
|
private val buff3x3: FloatBuffer by lazy { ByteBuffer.allocateDirect(4 * 3 * 3).also { it.order(ByteOrder.nativeOrder()) }.asFloatBuffer() }
|
||||||
private val buff4x4 by lazy { ByteBuffer.allocateDirect(4 * 4 * 4).also { it.order(ByteOrder.nativeOrder()) }.asFloatBuffer() }
|
private val buff4x4: FloatBuffer by lazy { ByteBuffer.allocateDirect(4 * 4 * 4).also { it.order(ByteOrder.nativeOrder()) }.asFloatBuffer() }
|
||||||
|
|
||||||
fun set(value: IFloatMatrix<*>): GLUniformLocation {
|
fun set(value: IFloatMatrix<*>): GLUniformLocation {
|
||||||
program.state.ensureSameThread()
|
program.state.ensureSameThread()
|
||||||
|
Loading…
Reference in New Issue
Block a user