当前位置: 首页>>代码示例>>C#>>正文


C# NativeLibrary类代码示例

本文整理汇总了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));
 }
开发者ID:DanWBR,项目名称:dwsim3,代码行数:10,代码来源:Bind.cs

示例2: NativeLibrary

 protected NativeLibrary(NativeLibrary.Internal* native, bool isInternalImpl = false)
 {
     __Instance = new global::System.IntPtr(native);
 }
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:4,代码来源:AST.cs

示例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;
 }
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:6,代码来源:AST.cs

示例4: __CreateInstance

 public static NativeLibrary __CreateInstance(NativeLibrary.Internal native)
 {
     return new NativeLibrary(native);
 }
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:4,代码来源:AST.cs

示例5: NativeLibrary

 protected NativeLibrary(NativeLibrary.Internal* native, bool skipVTables = false)
 {
     if (native == null)
         return;
     __Instance = new global::System.IntPtr(native);
 }
开发者ID:CSRedRat,项目名称:CppSharp,代码行数:6,代码来源:AST.cs

示例6: __CreateInstance

 public static NativeLibrary __CreateInstance(NativeLibrary.Internal native, bool skipVTables = false)
 {
     return new NativeLibrary(native, skipVTables);
 }
开发者ID:CSRedRat,项目名称:CppSharp,代码行数:4,代码来源:AST.cs

示例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();
 }
开发者ID:ddobrev,项目名称:CppSharp,代码行数:6,代码来源:CppSharp.CppParser.cs

示例8: NativeLibrary

 internal NativeLibrary(NativeLibrary.Internal native)
     : this(&native)
 {
 }
开发者ID:kidleon,项目名称:CppSharp,代码行数:4,代码来源:AST.cs

示例9: NativeLibrary

 private NativeLibrary(NativeLibrary.Internal native)
     : this(__CopyValue(native))
 {
     __ownsNativeInstance = true;
 }
开发者ID:KonajuGames,项目名称:CppSharp,代码行数:5,代码来源:AST.cs

示例10: NativeLibrary

 internal NativeLibrary(NativeLibrary.Internal native)
     : this(__CopyValue(native))
 {
 }
开发者ID:vovkasm,项目名称:CppSharp,代码行数:4,代码来源:AST.cs

示例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;
            }
        }
开发者ID:HannesMann,项目名称:libretro.NET,代码行数:46,代码来源:Core.cs


注:本文中的NativeLibrary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。