Add renderer support for matrix uniforms.

This commit is contained in:
Paul Chote
2013-02-22 23:05:13 +13:00
parent fb3e776cb9
commit 064938378f
4 changed files with 25 additions and 0 deletions

View File

@@ -81,5 +81,15 @@ namespace OpenRA.Renderer.Cg
if (param != IntPtr.Zero)
Tao.Cg.CgGl.cgGLSetParameter2f(param, x, y);
}
public void SetMatrix(string name, float[] mtx)
{
if (mtx.Length != 16)
throw new InvalidDataException("Invalid 4x4 matrix");
var param = Tao.Cg.Cg.cgGetNamedEffectParameter(effect, name);
if (param != IntPtr.Zero)
Tao.Cg.CgGl.cgGLSetMatrixParameterfr(param, mtx);
}
}
}