本文整理汇总了C#中NativeLibrary类的典型用法代码示例。如果您正苦于以下问题:C# NativeLibrary类的具体用法?C# NativeLibrary怎么用?C# NativeLibrary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NativeLibrary类属于命名空间,在下文中一共展示了NativeLibrary类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bind
internal static void Bind(NativeLibrary nativeLibrary)
{
Math.yepMath_Log_V64f_V64f = (yepMath_Log_V64f_V64f_Delegate)nativeLibrary.GetFunction("yepMath_Log_V64f_V64f", typeof(yepMath_Log_V64f_V64f_Delegate));
Math.yepMath_Exp_V64f_V64f = (yepMath_Exp_V64f_V64f_Delegate)nativeLibrary.GetFunction("yepMath_Exp_V64f_V64f", typeof(yepMath_Exp_V64f_V64f_Delegate));
Math.yepMath_Sin_V64f_V64f = (yepMath_Sin_V64f_V64f_Delegate)nativeLibrary.GetFunction("yepMath_Sin_V64f_V64f", typeof(yepMath_Sin_V64f_V64f_Delegate));
Math.yepMath_Cos_V64f_V64f = (yepMath_Cos_V64f_V64f_Delegate)nativeLibrary.GetFunction("yepMath_Cos_V64f_V64f", typeof(yepMath_Cos_V64f_V64f_Delegate));
Math.yepMath_Tan_V64f_V64f = (yepMath_Tan_V64f_V64f_Delegate)nativeLibrary.GetFunction("yepMath_Tan_V64f_V64f", typeof(yepMath_Tan_V64f_V64f_Delegate));
Math.yepMath_EvaluatePolynomial_V32fV32f_V32f = (yepMath_EvaluatePolynomial_V32fV32f_V32f_Delegate)nativeLibrary.GetFunction("yepMath_EvaluatePolynomial_V32fV32f_V32f", typeof(yepMath_EvaluatePolynomial_V32fV32f_V32f_Delegate));
Math.yepMath_EvaluatePolynomial_V64fV64f_V64f = (yepMath_EvaluatePolynomial_V64fV64f_V64f_Delegate)nativeLibrary.GetFunction("yepMath_EvaluatePolynomial_V64fV64f_V64f", typeof(yepMath_EvaluatePolynomial_V64fV64f_V64f_Delegate));
}
示例2: NativeLibrary
protected NativeLibrary(NativeLibrary.Internal* native, bool isInternalImpl = false)
{
__Instance = new global::System.IntPtr(native);
}
示例3: __CopyValue
private static NativeLibrary.Internal* __CopyValue(NativeLibrary.Internal native)
{
var ret = Marshal.AllocHGlobal(80);
CppSharp.Parser.AST.NativeLibrary.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (NativeLibrary.Internal*) ret;
}
示例4: __CreateInstance
public static NativeLibrary __CreateInstance(NativeLibrary.Internal native)
{
return new NativeLibrary(native);
}
示例5: NativeLibrary
protected NativeLibrary(NativeLibrary.Internal* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
示例6: __CreateInstance
public static NativeLibrary __CreateInstance(NativeLibrary.Internal native, bool skipVTables = false)
{
return new NativeLibrary(native, skipVTables);
}
示例7: __CopyValue
private static void* __CopyValue(NativeLibrary.__Internal native)
{
var ret = Marshal.AllocHGlobal(52);
global::CppSharp.Parser.AST.NativeLibrary.__Internal.cctor_1(ret, new global::System.IntPtr(&native));
return ret.ToPointer();
}
示例8: NativeLibrary
internal NativeLibrary(NativeLibrary.Internal native)
: this(&native)
{
}
示例9: NativeLibrary
private NativeLibrary(NativeLibrary.Internal native)
: this(__CopyValue(native))
{
__ownsNativeInstance = true;
}
示例10: NativeLibrary
internal NativeLibrary(NativeLibrary.Internal native)
: this(__CopyValue(native))
{
}
示例11: Core
/// <summary>
/// Loads the specified libretro implementation.
/// <para></para>
/// This core is not actually initialized until Initialize is called.
/// </summary>
/// <param name="filename">The filename of the dynamic library.</param>
/// <param name="info">Info about the frontend to pass to the core.</param>
/// <param name="multipleInstances">If this is true, the library may be copied to a temporary directory if another instance of it has already been loaded into process memory.</param>
public Core(string filename, FrontendInfo info, bool multipleInstances = true)
{
if (!instances.ContainsKey(filename))
{
instances.Add(filename, 0);
}
instances[filename]++;
if (multipleInstances && instances[filename] > 1)
{
string newFilename = Path.GetTempPath() + Path.DirectorySeparatorChar + Path.GetFileName(filename) + "." + instances[filename].ToString();
File.Copy(filename, newFilename, true);
filename = newFilename;
deleteOnExit = true;
}
frontEndInfo = info;
core = new NativeLibrary(filename);
LoadFunctions();
Variables = new Variables(new string[0], new string[0], new string[0][]);
Screen = new Screen();
Timing = new TimingInfo();
envCallback = Core_Environment;
vidCallback = Core_VideoRefresh;
audCallback = Core_AudioSample;
asbCallback = Core_AudioSampleBatch;
inpCallback = Core_InputPoll;
insCallback = Core_InputState;
rumCallback = Core_Rumble;
this.filename = filename;
// this is used by Core_Environment
unsafe
{
boolFalse = Marshal.AllocHGlobal(1);
boolTrue = Marshal.AllocHGlobal(1);
*((bool*)boolFalse) = false;
*((bool*)boolTrue) = true;
}
}