public override void SetParameter(string name, Gk3Main.Math.Matrix parameter) { EffectHandle param = getParameter(name); // convert the matrix, transposing as we go SharpDX.Mathematics.Interop.RawMatrix m; m.M11 = parameter.M11; m.M12 = parameter.M21; m.M13 = parameter.M31; m.M14 = parameter.M41; m.M21 = parameter.M12; m.M22 = parameter.M22; m.M23 = parameter.M32; m.M24 = parameter.M42; m.M31 = parameter.M13; m.M32 = parameter.M23; m.M33 = parameter.M33; m.M34 = parameter.M43; m.M41 = parameter.M14; m.M42 = parameter.M24; m.M43 = parameter.M34; m.M44 = parameter.M44; _effect.SetValue(param, m); }
public override void SetParameter(string name, Gk3Main.Math.Matrix parameter) { GL.GetError(); Uniform u = getUniform(name); if (u.GlHandle == -1) { return; } GL.UniformMatrix4(u.GlHandle, 1, false, ref parameter.M11); ErrorCode r = GL.GetError(); if (r != ErrorCode.NoError) { throw new Exception("Unable to set shader parameter: " + name); } }