gamnit :: UniformMat4 :: defaultinit
# Shader uniform of GLSL type `mat4`
class UniformMat4
super Uniform
private var native_matrix_cache: nullable NativeGLfloatArray = null
# Set this uniform value
fun uniform(matrix: Matrix)
do
var native = native_matrix_cache
if native == null then
native = new NativeGLfloatArray.matrix
self.native_matrix_cache = native
end
matrix.fill_native(native)
uniform_matrix_4f(location, 1, false, native)
end
private fun uniform_matrix_4f(index, count: Int, transpose: Bool, data: NativeGLfloatArray) `{
glUniformMatrix4fv(index, count, transpose, data);
`}
end
lib/gamnit/programs.nit:213,1--235,3