Added UniformMatrix3/3d/4d overloads

This commit is contained in:
Robert Rouhani 2013-01-16 17:53:00 -08:00
parent 56e75748b5
commit e6a855f00a
3 changed files with 56 additions and 11 deletions

View file

@ -137,6 +137,17 @@ namespace OpenTK.Graphics.ES20
GL.Uniform4(location, quaternion.X, quaternion.Y, quaternion.Z, quaternion.W); GL.Uniform4(location, quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
} }
public static void UniformMatrix3(int location, bool transpose, ref Matrix3 matrix)
{
unsafe
{
fixed (float* matrix_ptr = &matrix.Row0.X)
{
GL.UniformMatrix3(location, 1, transpose, matrix_ptr);
}
}
}
public static void UniformMatrix4(int location, bool transpose, ref Matrix4 matrix) public static void UniformMatrix4(int location, bool transpose, ref Matrix4 matrix)
{ {
unsafe unsafe

View file

@ -300,17 +300,6 @@ namespace OpenTK.Graphics.OpenGL
} }
} }
public static void UniformMatrix4(int location, bool transpose, ref Matrix4 matrix)
{
unsafe
{
fixed (float* matrix_ptr = &matrix.Row0.X)
{
GL.UniformMatrix4(location, 1, transpose, matrix_ptr);
}
}
}
public static void Normal3(Vector3d normal) public static void Normal3(Vector3d normal)
{ {
GL.Normal3(normal.X, normal.Y, normal.Z); GL.Normal3(normal.X, normal.Y, normal.Z);
@ -465,6 +454,50 @@ namespace OpenTK.Graphics.OpenGL
GL.Uniform4(location, quaternion.X, quaternion.Y, quaternion.Z, quaternion.W); GL.Uniform4(location, quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
} }
public static void UniformMatrix3(int location, bool transpose, ref Matrix3 matrix)
{
unsafe
{
fixed (float* matrix_ptr = &matrix.Row0.X)
{
GL.UniformMatrix3(location, 1, transpose, matrix_ptr);
}
}
}
public static void UniformMatrix3(int location, bool transpose, ref Matrix3d matrix)
{
unsafe
{
fixed (double* matrix_ptr = &matrix.Row0.X)
{
GL.UniformMatrix3(location, 1, transpose, matrix_ptr);
}
}
}
public static void UniformMatrix4(int location, bool transpose, ref Matrix4 matrix)
{
unsafe
{
fixed (float* matrix_ptr = &matrix.Row0.X)
{
GL.UniformMatrix4(location, 1, transpose, matrix_ptr);
}
}
}
public static void UniformMatrix4(int location, bool transpose, ref Matrix4d matrix)
{
unsafe
{
fixed (double* matrix_ptr = &matrix.Row0.X)
{
GL.UniformMatrix4(location, 1, transpose, matrix_ptr);
}
}
}
#endregion #endregion
#endregion #endregion

View file

@ -132,6 +132,7 @@
<Compile Include="Input\IInputDriver2.cs" /> <Compile Include="Input\IInputDriver2.cs" />
<Compile Include="Input\IKeyboardDriver2.cs" /> <Compile Include="Input\IKeyboardDriver2.cs" />
<Compile Include="Input\IMouseDriver2.cs" /> <Compile Include="Input\IMouseDriver2.cs" />
<Compile Include="Math\Matrix3.cs" />
<Compile Include="Platform\DisplayDeviceBase.cs" /> <Compile Include="Platform\DisplayDeviceBase.cs" />
<Compile Include="Platform\Windows\WinInputBase.cs" /> <Compile Include="Platform\Windows\WinInputBase.cs" />
<Compile Include="WindowBorder.cs"> <Compile Include="WindowBorder.cs">