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))); }
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); }
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); } }
public void Destroy(IHandle handle) { ValidateThread(); CoreInternals.Object_Free(GetPointerFromHandle(handle)); }
public void Dispose() { CoreInternals.Object_Free(ContextPtr); ContextPtr = IntPtr.Zero; }