OpenNI.Context.FromNative C# (CSharp) Method

FromNative() public static method

Creates a managed Context object to wrap a native one.
public static FromNative ( IntPtr pContext ) : Context
pContext IntPtr A pointer to the native object
return Context
        public static Context FromNative(IntPtr pContext)
        {
            lock (Context.staticLock)
            {
                if (Context.allContexts.ContainsKey(pContext))
                {
                    return Context.allContexts[pContext];
                }
                else
                {
                    return new Context(pContext);
                }
            }
        }

Usage Example

コード例 #1
0
ファイル: Context.cs プロジェクト: oliverfarkas/OpenNI
        static public ProductionNode CreateProductionNodeFromNative(IntPtr nodeHandle)
        {
            IntPtr  pContext = SafeNativeMethods.xnGetContextFromNodeHandle(nodeHandle);
            Context context  = Context.FromNative(pContext);

            return(context.CreateProductionNodeObject(nodeHandle));
        }