protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); all_textures.Remove(this); while (tryGetNextUpload(out var upload)) { upload.Dispose(); } GLWrapper.ScheduleDisposal(texture => { int disposableId = texture.textureId; if (disposableId <= 0) { return; } GL.DeleteTextures(1, new[] { disposableId }); texture.memoryLease?.Dispose(); texture.textureId = 0; }, this); }
protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); memoryLease?.Dispose(); GLWrapper.ScheduleDisposal(unload); }
public void Dispose() { if (referenceCount.Decrement() != 0) { return; } GLWrapper.ScheduleDisposal(() => Dispose(true)); GC.SuppressFinalize(this); }
public void Dispose() { if (Interlocked.Decrement(ref referenceCount) != 0) { return; } GLWrapper.ScheduleDisposal(node => node.Dispose(true), this); GC.SuppressFinalize(this); }
protected void Dispose(bool disposing) => GLWrapper.ScheduleDisposal(() => { if (disposing) { foreach (VertexBuffer <T> vbo in VertexBuffers) { vbo.Dispose(); } } });
protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); while (uploadQueue.TryDequeue(out TextureUpload u)) { u.Dispose(); } GLWrapper.ScheduleDisposal(unload); }
protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); while (tryGetNextUpload(out var upload)) { upload.Dispose(); } GLWrapper.ScheduleDisposal(unload); }
protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); if (isDisposed) return; isDisposed = true; GLWrapper.ScheduleDisposal(() => base.TextureGL.Dereference()); }
protected virtual void Dispose(bool disposing) { if (isDisposed) return; isDisposed = true; GLWrapper.ScheduleDisposal(delegate { GLWrapper.DeleteFramebuffer(frameBuffer); frameBuffer = -1; }); }
protected virtual void Dispose(bool disposing) => GLWrapper.ScheduleDisposal(() => { if (IsDisposed) return; if (isInitialised) { Unbind(); GL.DeleteBuffer(vboId); } IsDisposed = true; });
protected virtual void Dispose(bool disposing) => GLWrapper.ScheduleDisposal(() => { if (IsLoaded) { IsLoaded = false; Unbind(); GL.DeleteProgram(this); GlobalPropertyManager.Unregister(this); programID = -1; } });
protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); memoryLease?.Dispose(); GLWrapper.ScheduleDisposal(v => { int[] ids = v.textureIds; if (ids == null) { return; } for (int i = 0; i < ids.Length; i++) { if (ids[i] >= 0) { GL.DeleteTextures(1, new[] { ids[i] }); } } }, this); }
public void Dispose() { GLWrapper.ScheduleDisposal(d => d.Dispose(true), this); GC.SuppressFinalize(this); }
protected virtual void Dispose(bool isDisposing) => GLWrapper.ScheduleDisposal(() => Available = false);
protected virtual void Dispose(bool isDisposing) { GLWrapper.ScheduleDisposal(t => t.Available = false, this); }
protected void Dispose(bool disposing) => GLWrapper.ScheduleDisposal(delete);