158 lines
5.7 KiB
C#
158 lines
5.7 KiB
C#
using StgSharp.Math;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Numerics;
|
|
using System.Reflection;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
namespace StgSharp
|
|
{
|
|
internal static partial class internalIO
|
|
{
|
|
|
|
#region load
|
|
|
|
[DllImport(dllName: "StgSharpGraphic", EntryPoint = "load",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern ref Vector4 load_internal(float x,float y, float z, float w);
|
|
|
|
[DllImport(dllName: "StgSharpGraphic", EntryPoint = "load",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static unsafe extern Vector4* loadptr_internal(float x, float y, float z, float w);
|
|
|
|
[DllImport("StgSharpGraphic",EntryPoint = "load_matmap",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern IntPtr load_mat(IntPtr c0, IntPtr c1, IntPtr c2, IntPtr c3);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "load_cpy",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern IntPtr load_cpy_internal(IntPtr ptr);
|
|
|
|
|
|
#endregion
|
|
|
|
#region add sub
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "addps",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern IntPtr addps_internal(IntPtr ptr1, IntPtr ptr2);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "subps",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern IntPtr subps_internal(IntPtr ptr1, IntPtr ptr2);
|
|
|
|
#endregion
|
|
|
|
#region mulps
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "mulps",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern IntPtr mulps_internal(IntPtr ptr1, IntPtr ptr2);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "mulps_const",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern IntPtr mulps_const_internal(IntPtr ptr, float value);
|
|
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "mulps_sum",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern float mulps_sum_internal(IntPtr ptr1, IntPtr ptr2);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "mulps_sum",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern unsafe float mulps_sum_internal(Vector4* ptr1, Vector4* ptr2);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "mulps_sum",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern unsafe float mulps_sum_internal(Vec4d* ptr1, Vec4d* ptr2);
|
|
|
|
#endregion
|
|
|
|
#region div
|
|
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "mulps",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern IntPtr divps_internal(IntPtr ptr1, IntPtr ptr2);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "divps_const",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern IntPtr divps_const_internal(IntPtr ptr, float value);
|
|
|
|
#endregion
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "sqrtss_const",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern float sqrtss_const_internal(float a);
|
|
|
|
|
|
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "set_Vector4ptr_default",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern IntPtr set_Vector4ptr_default_internal();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region deinit Vector4
|
|
|
|
[DllImport(
|
|
"msvcrt.dll",
|
|
EntryPoint = "_aligned_free",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern unsafe void deinit_internal(Vector4* ptr);
|
|
|
|
[DllImport(
|
|
"msvcrt.dll",
|
|
EntryPoint = "_aligned_free",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern unsafe void deinit_internal(Mat2* ptr);
|
|
|
|
/*
|
|
[DllImport(
|
|
"msvcrt.dll",
|
|
EntryPoint = "_aligned_free",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern unsafe void deinit_internal(Mat3* ptr);
|
|
*/
|
|
|
|
[DllImport(
|
|
"msvcrt.dll",
|
|
EntryPoint = "_aligned_free",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern unsafe void deinit_internal(Mat4* ptr);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "deinitVector4",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern void deinitVector4_internal(ref Vector4 vec);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "deinitVector4",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern unsafe void deinitVector4_internal(Vector4* vec);
|
|
|
|
#endregion
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "deinit_matmapPtr_sse",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern void deinitMatmapPtr_sse_internal(ref Vector4Map mapPtr);
|
|
|
|
[DllImport("StgSharpGraphic", EntryPoint = "deinit_matmap_sse",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
internal static extern void deinitMatmap_sse_internal(ref Vector4Map mapPtr);
|
|
|
|
}
|
|
}
|