/// <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(); }
public void SetSurface(IntPtr eglSurface, GlContext glContext) { UnsafeNativeMethods.mp_EglSurfaceHolder__SetSurface__P_Pgc(mpPtr, eglSurface, glContext.mpPtr, out var statusPtr).Assert(); }
public GlTextureBuffer(UInt32 name, int width, int height, GpuBufferFormat format, DeletionCallback callback, GlContext glContext = null) : this(Gl.GL_TEXTURE_2D, name, width, height, format, callback, glContext) { }