diff --git a/kgl-android/src/main/kotlin/com/danielgergely/kgl/KglAndroid.kt b/kgl-android/src/main/kotlin/com/danielgergely/kgl/KglAndroid.kt index 46e85b7..6795f56 100644 --- a/kgl-android/src/main/kotlin/com/danielgergely/kgl/KglAndroid.kt +++ b/kgl-android/src/main/kotlin/com/danielgergely/kgl/KglAndroid.kt @@ -90,27 +90,46 @@ object KglAndroid : Kgl { override fun enable(cap: Int) = GL.glEnable(cap) override fun disable(cap: Int) = GL.glDisable(cap) - override fun uniform1f(location: UniformLocation, f: Float) = GL.glUniform1f(location, f) - override fun uniform1i(location: UniformLocation, i: Int) = GL.glUniform1i(location, i) - - override fun uniform2f(location: UniformLocation, x: Float, y: Float) = GL.glUniform2f(location, x, y) - override fun uniform2i(location: UniformLocation, x: Int, y: Int) = GL.glUniform2i(location, x, y) - - override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) = GL.glUniform3f(location, x, y, z) - override fun uniform3fv(location: UniformLocation, value: FloatArray) = GL.glUniform3fv(location, 1, value, 0) - override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) = GL.glUniform3i(location, x, y, z) + override fun uniform1f(location: UniformLocation, f: Float) = + GL.glUniform1f(location, f) + override fun uniform1fv(location: UniformLocation, value: FloatArray) = + GL.glUniform1fv(location, value.vSize(1), value, 0) + override fun uniform1i(location: UniformLocation, i: Int) = + GL.glUniform1i(location, i) + override fun uniform1iv(location: UniformLocation, value: IntArray) = + GL.glUniform1iv(location, value.vSize(1), value, 0) + + override fun uniform2f(location: UniformLocation, x: Float, y: Float) = + GL.glUniform2f(location, x, y) + override fun uniform2fv(location: UniformLocation, value: FloatArray) = + GL.glUniform2fv(location, value.vSize(2), value, 0) + override fun uniform2i(location: UniformLocation, x: Int, y: Int) = + GL.glUniform2i(location, x, y) + override fun uniform2iv(location: UniformLocation, value: IntArray) = + GL.glUniform2iv(location, value.vSize(2), value, 0) + + override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) = + GL.glUniform3f(location, x, y, z) + override fun uniform3fv(location: UniformLocation, value: FloatArray) = + GL.glUniform3fv(location, value.vSize(3), value, 0) + override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) = + GL.glUniform3i(location, x, y, z) + override fun uniform3iv(location: UniformLocation, value: IntArray) = + GL.glUniform3iv(location, value.vSize(3), value, 0) override fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float) = GL.glUniform4f(location, x, y, z, w) - + override fun uniform4fv(location: UniformLocation, value: FloatArray) = + GL.glUniform4fv(location, value.vSize(4), value, 0) override fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int) = GL.glUniform4i(location, x, y, z, w) + override fun uniform4iv(location: UniformLocation, value: IntArray) = + GL.glUniform4iv(location, value.vSize(4), value, 0) override fun uniformMatrix3fv(location: Int, transpose: Boolean, value: FloatArray) = - GL.glUniformMatrix3fv(location, 1, transpose, value, 0) - + GL.glUniformMatrix3fv(location, value.vSize(3*3), transpose, value, 0) override fun uniformMatrix4fv(location: Int, transpose: Boolean, value: FloatArray) = - GL.glUniformMatrix4fv(location, 1, transpose, value, 0) + GL.glUniformMatrix4fv(location, value.vSize(4*4), transpose, value, 0) override fun blendFunc(sFactor: Int, dFactor: Int) = GL.glBlendFunc(sFactor, dFactor) @@ -240,3 +259,15 @@ object KglAndroid : Kgl { } } } + +private fun FloatArray.vSize(vecSize: Int): Int { + if (size % vecSize != 0) + throw IllegalArgumentException("Array size must be a multiple of $vecSize.") + return size / vecSize +} + +private fun IntArray.vSize(vecSize: Int): Int { + if (size % vecSize != 0) + throw IllegalArgumentException("Array size must be a multiple of $vecSize.") + return size / vecSize +} diff --git a/kgl-ios/src/nativeMain/kotlin/com.danielgergely.kgl/KglIos.kt b/kgl-ios/src/nativeMain/kotlin/com.danielgergely.kgl/KglIos.kt index 5eae076..6b86c8f 100644 --- a/kgl-ios/src/nativeMain/kotlin/com.danielgergely.kgl/KglIos.kt +++ b/kgl-ios/src/nativeMain/kotlin/com.danielgergely.kgl/KglIos.kt @@ -195,49 +195,47 @@ object KglIos : Kgl { ) } - override fun uniform1f(location: UniformLocation, f: Float) { + override fun uniform1f(location: UniformLocation, f: Float) = glUniform1f(location, f) - } - - override fun uniform1i(location: UniformLocation, i: Int) { + override fun uniform1fv(location: UniformLocation, value: FloatArray) = + glUniform1fv(location, value.vSize(1), value.refTo(0)) + override fun uniform1i(location: UniformLocation, i: Int) = glUniform1i(location, i) - } + override fun uniform1iv(location: UniformLocation, value: IntArray) = + glUniform1iv(location, value.vSize(1), value.refTo(0)) - override fun uniform2f(location: UniformLocation, x: Float, y: Float) { + override fun uniform2f(location: UniformLocation, x: Float, y: Float) = glUniform2f(location, x, y) - } - - override fun uniform2i(location: UniformLocation, x: Int, y: Int) { + override fun uniform2fv(location: UniformLocation, value: FloatArray) = + glUniform2fv(location, value.vSize(2), value.refTo(0)) + override fun uniform2i(location: UniformLocation, x: Int, y: Int) = glUniform2i(location, x, y) - } + override fun uniform2iv(location: UniformLocation, value: IntArray) = + glUniform2iv(location, value.vSize(2), value.refTo(0)) - override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) { + override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) = glUniform3f(location, x, y, z) - } - - override fun uniform3fv(location: UniformLocation, value: FloatArray) { - glUniform3fv(location, 1, value.refTo(0)) - } - - override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) { + override fun uniform3fv(location: UniformLocation, value: FloatArray) = + glUniform3fv(location, value.vSize(3), value.refTo(0)) + override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) = glUniform3i(location, x, y, z) - } + override fun uniform3iv(location: UniformLocation, value: IntArray) = + glUniform3iv(location, value.vSize(3), value.refTo(0)) - override fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float) { + override fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float) = glUniform4f(location, x, y, z, w) - } - - override fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int) { + override fun uniform4fv(location: UniformLocation, value: FloatArray) = + glUniform4fv(location, value.vSize(4), value.refTo(0)) + override fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int) = glUniform4i(location, x, y, z, w) - } + override fun uniform4iv(location: UniformLocation, value: IntArray) = + glUniform4iv(location, value.vSize(4), value.refTo(0)) - override fun uniformMatrix3fv(location: UniformLocation, transpose: Boolean, value: FloatArray) { - glUniformMatrix3fv(location, 1, transpose.toGl(), value.refTo(0)) - } + override fun uniformMatrix3fv(location: UniformLocation, transpose: Boolean, value: FloatArray) = + glUniformMatrix3fv(location, value.vSize(3*3), transpose.toGl(), value.refTo(0)) - override fun uniformMatrix4fv(location: UniformLocation, transpose: Boolean, value: FloatArray) { - glUniformMatrix4fv(location, 1, transpose.toGl(), value.refTo(0)) - } + override fun uniformMatrix4fv(location: UniformLocation, transpose: Boolean, value: FloatArray) = + glUniformMatrix4fv(location, value.vSize(4*4), transpose.toGl(), value.refTo(0)) override fun blendFunc(sFactor: Int, dFactor: Int) { glBlendFunc(sFactor.toUInt(), dFactor.toUInt()) @@ -468,3 +466,15 @@ object KglIos : Kgl { private fun Boolean.toGl(): GLboolean = if (this) 1u else 0u private fun UByte.toBoolean() = this != platform.gles3.GL_FALSE.toUByte() + +private fun FloatArray.vSize(vecSize: Int): Int { + if (size % vecSize != 0) + throw IllegalArgumentException("Array size must be a multiple of $vecSize.") + return size / vecSize +} + +private fun IntArray.vSize(vecSize: Int): Int { + if (size % vecSize != 0) + throw IllegalArgumentException("Array size must be a multiple of $vecSize.") + return size / vecSize +} \ No newline at end of file diff --git a/kgl-jogl/src/main/kotlin/com/danielgergely/kgl/KglJogl.kt b/kgl-jogl/src/main/kotlin/com/danielgergely/kgl/KglJogl.kt index d4f00e2..8b654de 100644 --- a/kgl-jogl/src/main/kotlin/com/danielgergely/kgl/KglJogl.kt +++ b/kgl-jogl/src/main/kotlin/com/danielgergely/kgl/KglJogl.kt @@ -142,31 +142,46 @@ class KglJogl(private val gl: GL) : Kgl { return gl.glVertexAttribPointer(location, size, type, normalized, stride, offset.toLong()) } - override fun uniform1f(location: UniformLocation, f: Float) = gl.glUniform1f(location, f) - - override fun uniform1i(location: UniformLocation, i: Int) = gl.glUniform1i(location, i) - - override fun uniform2f(location: UniformLocation, x: Float, y: Float) = gl.glUniform2f(location, x, y) - - override fun uniform2i(location: UniformLocation, x: Int, y: Int) = gl.glUniform2i(location, x, y) - - override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) = gl.glUniform3f(location, x, y, z) - - override fun uniform3fv(location: UniformLocation, value: FloatArray) = gl.glUniform3fv(location, 1, value, 0) - - override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) = gl.glUniform3i(location, x, y, z) + override fun uniform1f(location: UniformLocation, f: Float) = + gl.glUniform1f(location, f) + override fun uniform1fv(location: UniformLocation, value: FloatArray) = + gl.glUniform1fv(location, value.vSize(1), value, 0) + override fun uniform1i(location: UniformLocation, i: Int) = + gl.glUniform1i(location, i) + override fun uniform1iv(location: UniformLocation, value: IntArray) = + gl.glUniform1iv(location, value.vSize(1), value, 0) + + override fun uniform2f(location: UniformLocation, x: Float, y: Float) = + gl.glUniform2f(location, x, y) + override fun uniform2fv(location: UniformLocation, value: FloatArray) = + gl.glUniform2fv(location, value.vSize(2), value, 0) + override fun uniform2i(location: UniformLocation, x: Int, y: Int) = + gl.glUniform2i(location, x, y) + override fun uniform2iv(location: UniformLocation, value: IntArray) = + gl.glUniform2iv(location, value.vSize(2), value, 0) + + override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) = + gl.glUniform3f(location, x, y, z) + override fun uniform3fv(location: UniformLocation, value: FloatArray) = + gl.glUniform3fv(location, value.vSize(3), value, 0) + override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) = + gl.glUniform3i(location, x, y, z) + override fun uniform3iv(location: UniformLocation, value: IntArray) = + gl.glUniform3iv(location, value.vSize(3), value, 0) override fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float) = gl.glUniform4f(location, x, y, z, w) - + override fun uniform4fv(location: UniformLocation, value: FloatArray) = + gl.glUniform4fv(location, value.vSize(4), value, 0) override fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int) = gl.glUniform4i(location, x, y, z, w) + override fun uniform4iv(location: UniformLocation, value: IntArray) = + gl.glUniform4iv(location, value.vSize(4), value, 0) override fun uniformMatrix3fv(location: UniformLocation, transpose: Boolean, value: FloatArray) = - gl.glUniformMatrix3fv(location, 1, transpose, value, 0) - + gl.glUniformMatrix3fv(location, value.vSize(3*3), transpose, value, 0) override fun uniformMatrix4fv(location: UniformLocation, transpose: Boolean, value: FloatArray) = - gl.glUniformMatrix4fv(location, 1, transpose, value, 0) + gl.glUniformMatrix4fv(location, value.vSize(4*4), transpose, value, 0) override fun blendFunc(sFactor: Int, dFactor: Int) = gl.glBlendFunc(sFactor, dFactor) @@ -318,3 +333,15 @@ fun imageToByteBuffer(image: BufferedImage): ByteBuffer { return buffer } + +private fun FloatArray.vSize(vecSize: Int): Int { + if (size % vecSize != 0) + throw IllegalArgumentException("Array size must be a multiple of $vecSize.") + return size / vecSize +} + +private fun IntArray.vSize(vecSize: Int): Int { + if (size % vecSize != 0) + throw IllegalArgumentException("Array size must be a multiple of $vecSize.") + return size / vecSize +} \ No newline at end of file diff --git a/kgl-lwjgl/src/main/kotlin/com/danielgergely/kgl/KglLwjgl.kt b/kgl-lwjgl/src/main/kotlin/com/danielgergely/kgl/KglLwjgl.kt index 8d743ec..bde6eba 100644 --- a/kgl-lwjgl/src/main/kotlin/com/danielgergely/kgl/KglLwjgl.kt +++ b/kgl-lwjgl/src/main/kotlin/com/danielgergely/kgl/KglLwjgl.kt @@ -267,49 +267,46 @@ object KglLwjgl : Kgl { GL.glTexParameteri(target, pname, value) } - override fun uniform1f(location: UniformLocation, f: Float) { + override fun uniform1f(location: UniformLocation, f: Float) = GL.glUniform1f(location, f) - } - - override fun uniform1i(location: UniformLocation, i: Int) { + override fun uniform1fv(location: UniformLocation, value: FloatArray) = + GL.glUniform1fv(location, value) + override fun uniform1i(location: UniformLocation, i: Int) = GL.glUniform1i(location, i) - } + override fun uniform1iv(location: UniformLocation, value: IntArray) = + GL.glUniform1iv(location, value) - override fun uniform2f(location: UniformLocation, x: Float, y: Float) { + override fun uniform2f(location: UniformLocation, x: Float, y: Float) = GL.glUniform2f(location, x, y) - } - - override fun uniform2i(location: UniformLocation, x: Int, y: Int) { + override fun uniform2fv(location: UniformLocation, value: FloatArray) = + GL.glUniform2fv(location, value) + override fun uniform2i(location: UniformLocation, x: Int, y: Int) = GL.glUniform2i(location, x, y) - } + override fun uniform2iv(location: UniformLocation, value: IntArray) = + GL.glUniform2iv(location, value) - override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) { + override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) = GL.glUniform3f(location, x, y, z) - } - - override fun uniform3fv(location: UniformLocation, value: FloatArray) { + override fun uniform3fv(location: UniformLocation, value: FloatArray) = GL.glUniform3fv(location, value) - } - - override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) { + override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) = GL.glUniform3i(location, x, y, z) - } + override fun uniform3iv(location: UniformLocation, value: IntArray) = + GL.glUniform3iv(location, value) - override fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float) { + override fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float) = GL.glUniform4f(location, x, y, z, w) - } - - override fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int) { + override fun uniform4fv(location: UniformLocation, value: FloatArray) = + GL.glUniform4fv(location, value) + override fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int) = GL.glUniform4i(location, x, y, z, w) - } + override fun uniform4iv(location: UniformLocation, value: IntArray) = + GL.glUniform4iv(location, value) - override fun uniformMatrix3fv(location: UniformLocation, transpose: Boolean, value: FloatArray) { + override fun uniformMatrix3fv(location: UniformLocation, transpose: Boolean, value: FloatArray) = GL.glUniformMatrix3fv(location, transpose, value) - } - - override fun uniformMatrix4fv(location: UniformLocation, transpose: Boolean, value: FloatArray) { + override fun uniformMatrix4fv(location: UniformLocation, transpose: Boolean, value: FloatArray) = GL.glUniformMatrix4fv(location, transpose, value) - } override fun useProgram(programId: Program) { GL.glUseProgram(programId) diff --git a/kgl/src/commonMain/kotlin/com/danielgergely/kgl/DebugKgl.kt b/kgl/src/commonMain/kotlin/com/danielgergely/kgl/DebugKgl.kt index d6644ac..acb96dc 100644 --- a/kgl/src/commonMain/kotlin/com/danielgergely/kgl/DebugKgl.kt +++ b/kgl/src/commonMain/kotlin/com/danielgergely/kgl/DebugKgl.kt @@ -209,6 +209,13 @@ public class DebugKgl( return ret } + override fun uniform1fv(location: UniformLocation, value: FloatArray) { + runBefore("uniform1fv") + val ret = kgl.uniform1fv(location, value) + runAfter("uniform1fv") + return ret + } + override fun uniform1i(location: UniformLocation, i: Int) { runBefore("uniform1i") val ret = kgl.uniform1i(location, i) @@ -216,6 +223,13 @@ public class DebugKgl( return ret } + override fun uniform1iv(location: UniformLocation, value: IntArray) { + runBefore("uniform1iv") + val ret = kgl.uniform1iv(location, value) + runAfter("uniform1iv") + return ret + } + override fun uniform2f(location: UniformLocation, x: Float, y: Float) { runBefore("uniform2f") val ret = kgl.uniform2f(location, x, y) @@ -223,6 +237,13 @@ public class DebugKgl( return ret } + override fun uniform2fv(location: UniformLocation, value: FloatArray) { + runBefore("uniform2fv") + val ret = kgl.uniform2fv(location, value) + runAfter("uniform2fv") + return ret + } + override fun uniform2i(location: UniformLocation, x: Int, y: Int) { runBefore("uniform2i") val ret = kgl.uniform2i(location, x, y) @@ -230,6 +251,13 @@ public class DebugKgl( return ret } + override fun uniform2iv(location: UniformLocation, value: IntArray) { + runBefore("uniform2iv") + val ret = kgl.uniform2iv(location, value) + runAfter("uniform2iv") + return ret + } + override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) { runBefore("uniform3f") val ret = kgl.uniform3f(location, x, y, z) @@ -251,6 +279,13 @@ public class DebugKgl( return ret } + override fun uniform3iv(location: UniformLocation, value: IntArray) { + runBefore("uniform3iv") + val ret = kgl.uniform3iv(location, value) + runAfter("uniform3iv") + return ret + } + override fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float) { runBefore("uniform4f") val ret = kgl.uniform4f(location, x, y, z, w) @@ -258,6 +293,13 @@ public class DebugKgl( return ret } + override fun uniform4fv(location: UniformLocation, value: FloatArray) { + runBefore("uniform4fv") + val ret = kgl.uniform4fv(location, value) + runAfter("uniform4fv") + return ret + } + override fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int) { runBefore("uniform4i") val ret = kgl.uniform4i(location, x, y, z, w) @@ -265,6 +307,13 @@ public class DebugKgl( return ret } + override fun uniform4iv(location: UniformLocation, value: IntArray) { + runBefore("uniform4iv") + val ret = kgl.uniform4iv(location, value) + runAfter("uniform4iv") + return ret + } + override fun uniformMatrix3fv(location: UniformLocation, transpose: Boolean, value: FloatArray) { runBefore("uniformMatrix3fv") val ret = kgl.uniformMatrix3fv(location, transpose, value) diff --git a/kgl/src/commonMain/kotlin/com/danielgergely/kgl/Kgl.kt b/kgl/src/commonMain/kotlin/com/danielgergely/kgl/Kgl.kt index c2a335e..56f71c7 100644 --- a/kgl/src/commonMain/kotlin/com/danielgergely/kgl/Kgl.kt +++ b/kgl/src/commonMain/kotlin/com/danielgergely/kgl/Kgl.kt @@ -39,17 +39,24 @@ public interface Kgl { public fun vertexAttribPointer(location: Int, size: Int, type: Int, normalized: Boolean, stride: Int, offset: Int) public fun uniform1f(location: UniformLocation, f: Float) + public fun uniform1fv(location: UniformLocation, value: FloatArray) public fun uniform1i(location: UniformLocation, i: Int) + public fun uniform1iv(location: UniformLocation, value: IntArray) public fun uniform2f(location: UniformLocation, x: Float, y: Float) + public fun uniform2fv(location: UniformLocation, value: FloatArray) public fun uniform2i(location: UniformLocation, x: Int, y: Int) + public fun uniform2iv(location: UniformLocation, value: IntArray) public fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float) public fun uniform3fv(location: UniformLocation, value: FloatArray) public fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int) + public fun uniform3iv(location: UniformLocation, value: IntArray) public fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float) + public fun uniform4fv(location: UniformLocation, value: FloatArray) public fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int) + public fun uniform4iv(location: UniformLocation, value: IntArray) public fun uniformMatrix3fv(location: UniformLocation, transpose: Boolean, value: FloatArray) public fun uniformMatrix4fv(location: UniformLocation, transpose: Boolean, value: FloatArray) diff --git a/kgl/src/jsMain/kotlin/com/danielgergely/kgl/Kgl.kt b/kgl/src/jsMain/kotlin/com/danielgergely/kgl/Kgl.kt index 28881a3..e8e590d 100644 --- a/kgl/src/jsMain/kotlin/com/danielgergely/kgl/Kgl.kt +++ b/kgl/src/jsMain/kotlin/com/danielgergely/kgl/Kgl.kt @@ -87,35 +87,43 @@ public class KglJs(private val gl: WebGLRenderingContext) : Kgl { public override fun uniform1f(location: UniformLocation, f: Float): Unit = gl.uniform1f(location.unsafeCast(), f) - + public override fun uniform1fv(location: UniformLocation, value: FloatArray): Unit = + gl.uniform1fv(location.unsafeCast(), value.unsafeCast()) public override fun uniform1i(location: UniformLocation, i: Int): Unit = gl.uniform1i(location.unsafeCast(), i) + public override fun uniform1iv(location: UniformLocation, value: IntArray): Unit = + gl.uniform1iv(location.unsafeCast(), value.unsafeCast()) public override fun uniform2f(location: UniformLocation, x: Float, y: Float): Unit = gl.uniform2f(location.unsafeCast(), x, y) - + public override fun uniform2fv(location: UniformLocation, value: FloatArray): Unit = + gl.uniform2fv(location.unsafeCast(), value.unsafeCast()) public override fun uniform2i(location: UniformLocation, x: Int, y: Int): Unit = gl.uniform2i(location.unsafeCast(), x, y) + public override fun uniform2iv(location: UniformLocation, value: IntArray): Unit = + gl.uniform2iv(location.unsafeCast(), value.unsafeCast()) public override fun uniform3f(location: UniformLocation, x: Float, y: Float, z: Float): Unit = gl.uniform3f(location.unsafeCast(), x, y, z) - public override fun uniform3fv(location: UniformLocation, value: FloatArray): Unit = gl.uniform3fv(location.unsafeCast(), value.unsafeCast()) - public override fun uniform3i(location: UniformLocation, x: Int, y: Int, z: Int): Unit = gl.uniform3i(location.unsafeCast(), x, y, z) + public override fun uniform3iv(location: UniformLocation, value: IntArray): Unit = + gl.uniform3iv(location.unsafeCast(), value.unsafeCast()) public override fun uniform4f(location: UniformLocation, x: Float, y: Float, z: Float, w: Float): Unit = gl.uniform4f(location.unsafeCast(), x, y, z, w) - + public override fun uniform4fv(location: UniformLocation, value: FloatArray): Unit = + gl.uniform4fv(location.unsafeCast(), value.unsafeCast()) public override fun uniform4i(location: UniformLocation, x: Int, y: Int, z: Int, w: Int): Unit = gl.uniform4i(location.unsafeCast(), x, y, z, w) + public override fun uniform4iv(location: UniformLocation, value: IntArray): Unit = + gl.uniform4iv(location.unsafeCast(), value.unsafeCast()) public override fun uniformMatrix3fv(location: UniformLocation, transpose: Boolean, value: dynamic) { gl.uniformMatrix3fv(location.unsafeCast(), transpose, value.unsafeCast()) } - public override fun uniformMatrix4fv(location: UniformLocation, transpose: Boolean, value: dynamic) { gl.uniformMatrix4fv(location.unsafeCast(), transpose, value.unsafeCast()) }