Create rlMultMatrixf safe overload
This commit is contained in:
parent
7325ecc17d
commit
5a198187ec
1 changed files with 20 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
|
|
||||||
|
|
@ -95,10 +96,28 @@ namespace Raylib_cs
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void rlScalef(float x, float y, float z);
|
public static extern void rlScalef(float x, float y, float z);
|
||||||
|
|
||||||
/// <summary>Multiply the current matrix by another matrix</summary>
|
/// <summary>
|
||||||
|
/// Multiply the current matrix by another matrix
|
||||||
|
/// <br/>
|
||||||
|
/// Current Matrix can be set via <see cref="rlMatrixMode(int)"/>
|
||||||
|
/// </summary>
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void rlMultMatrixf(float* matf);
|
public static extern void rlMultMatrixf(float* matf);
|
||||||
|
|
||||||
|
public static void rlMultMatrixf(ref Matrix4x4 matf)
|
||||||
|
{
|
||||||
|
var pinned = new GCHandle();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
pinned = GCHandle.Alloc(matf, GCHandleType.Pinned);
|
||||||
|
rlMultMatrixf((float*)pinned.AddrOfPinnedObject());
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
pinned.Free();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar);
|
public static extern void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue