This helper function works, but seems hacked.
Basically, it just passes the address to Row0, Col0. Since C # gives no guarantees regarding the order of fields in the structure, although theoretically this works as luck more than anything else.
public static void UniformMatrix4(int location, Matrix4 value)
{
GL.UniformMatrix4(location, 1, false, ref value.Row0.X);
}
Of course, OpenTK should have bindings that allow you to pass Matrix4 directly.
source
share