コード例 #1
0
        public IComponent ListGetterCallback(IntPtr handle)
        {
            if (handle.Equals(IntPtr.Zero))
            {
                return(null);
            }
            uint hashCode = CoreInternals.Object_GetHashCode(handle);

            return(TryBindReferenceHolder(handle, (handler) => Wrap(hashCode, handler)));
        }
コード例 #2
0
        public RootDriver()
        {
            CurrentThread = Thread.CurrentThread;

            ContextPtr = CoreInternals.Context_New();

            ActorDriver     = new ActorDriver(this);
            WorldDriver     = new WorldDriver(this);
            CoreDriver      = new CoreDriver(this);
            EngineDriver    = new EngineDriver(this);
            ComponentDriver = new ComponentDriver(this);

            ResourcesCollection = new ResourceCollection(this);
            ComponentCollection = new ComponentCollection();
            // Setup Internal Drivers
            ResourceManagerDriver = new ResourceManagerDriver(this);
            MeshDriver            = new MeshDriver(this);
        }
コード例 #3
0
        public static bool TryGetGCHandle(IHandle handle, out GCHandle?gcHandle)
        {
            IntPtr ptr = GetPtrFromHandle(handle);

            if (ptr.Equals(IntPtr.Zero))
            {
                gcHandle = null;
                return(false);
            }
            IntPtr pinnedPtr = CoreInternals.Object_GetManagedRefPtr(ptr);

            if (pinnedPtr.Equals(IntPtr.Zero))
            {
                gcHandle = null;
                return(false);
            }
            else
            {
                gcHandle = GCHandle.FromIntPtr(pinnedPtr);
                return(true);
            }
        }
コード例 #4
0
 public void Destroy(IHandle handle)
 {
     ValidateThread();
     CoreInternals.Object_Free(GetPointerFromHandle(handle));
 }
コード例 #5
0
 public void Dispose()
 {
     CoreInternals.Object_Free(ContextPtr);
     ContextPtr = IntPtr.Zero;
 }