Exemplo n.º 1
0
func (c *Context) UniformMatrix2fv(location *UniformLocation, transpose bool, value []float32) {
	// TODO: count value of 1 is currently hardcoded.
	//       Perhaps it should be len(value) / 16 or something else?
	//       In OpenGL 2.1 it is a manually supplied parameter, but WebGL does not have it.
	//       Not sure if WebGL automatically deduces it and supports count values greater than 1, or if 1 is always assumed.
	gl.UniformMatrix2fv(location.int32, 1, transpose, &value[0])
}
Exemplo n.º 2
0
// UniformMatrix2fv writes 2x2 matrices. Each matrix uses four
// float32 values, so the number of matrices written is len(src)/4.
//
// Each matrix must be supplied in column major order.
//
// http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml
func UniformMatrix2fv(dst Uniform, src []float32) {
	gl.UniformMatrix2fv(dst.Value, int32(len(src)/(2*2)), false, &src[0])
}