Example #1
0
 /// <summary>
 /// Sets the parameter's value.
 /// </summary>
 /// <param name="pValue">A pointer to the buffer that contains the value to set.</param>
 /// <param name="count">The number of elements in the array to set.</param>
 public void SetValue(Mat4x3 *pValue, Int32 count)
 {
     SetMatrixArrayValueInternal <Mat4x3>((IntPtr)pValue, count,
                                          (ptr, index) => Mat4x3.Transpose(ref ((Mat4x3 *)ptr)[index], out ((Mat3x4 *)ptr)[index]),
                                          (ptr, index) => Mat3x4.Transpose(ref ((Mat3x4 *)ptr)[index], out ((Mat4x3 *)ptr)[index]),
                                          (l, c, t, v) => gl.UniformMatrix4x3fv(l, c, t, (Single *)v));
 }
Example #2
0
        /// <summary>
        /// Sets the parameter's value.
        /// </summary>
        /// <param name="value">The value to set.</param>
        public void SetValue(Mat4x3 value)
        {
            var transpose = gl.IsMatrixTranspositionAvailable;

            if (transpose)
            {
                gl.UniformMatrix4x3fv(location, 1, true, (Single *)&value);
                gl.ThrowIfError();
            }
            else
            {
                Mat4x3.Transpose(ref value, out var valueTransposed);

                gl.UniformMatrix4x3fv(location, 1, false, (Single *)&valueTransposed);
                gl.ThrowIfError();
            }
        }