protected override void DisposeManaged() { if (sharedPtrHandle != null) { sharedPtrHandle.Dispose(); sharedPtrHandle = null; } base.DisposeManaged(); }
/// <param name="callback"> /// A function called when the texture buffer is deleted. /// Make sure that this function doesn't throw exceptions and won't be GCed. /// </param> public GlTextureBuffer(UInt32 target, UInt32 name, int width, int height, GpuBufferFormat format, DeletionCallback callback, GlContext glContext) { var sharedContextPtr = glContext == null ? IntPtr.Zero : glContext.sharedPtr; UnsafeNativeMethods.mp_SharedGlTextureBuffer__ui_ui_i_i_ui_PF_PSgc( target, name, width, height, format, callback, sharedContextPtr, out var ptr).Assert(); sharedPtrHandle = new SharedPtr(ptr); this.ptr = sharedPtrHandle.Get(); }
/// <param name="ptr">Shared pointer of mediapipe::GpuResources</param> public GpuResources(IntPtr ptr) : base() { sharedPtrHandle = new SharedPtr(ptr); this.ptr = sharedPtrHandle.Get(); }
public GlContext(IntPtr ptr, bool isOwner = true) : base(isOwner) { sharedPtrHandle = new SharedPtr(ptr, isOwner); this.ptr = sharedPtrHandle.Get(); }
public GlSyncPoint(IntPtr ptr) : base(ptr) { sharedPtrHandle = new SharedPtr(ptr); this.ptr = sharedPtrHandle.Get(); }
public GlTextureBuffer(IntPtr ptr, bool isOwner = true) : base(isOwner) { _sharedPtrHandle = new SharedPtr(ptr, isOwner); this.ptr = _sharedPtrHandle.Get(); }
public GlContext(IntPtr ptr) : base(ptr) { sharedPtrHandle = new SharedPtr(ptr); this.ptr = sharedPtrHandle.Get(); }
private GlTextureBuffer(IntPtr ptr) : base() { sharedPtrHandle = new SharedPtr(ptr); this.ptr = sharedPtrHandle.Get(); }