private void ReleaseUnmanagedResources() { if (_disposed) { return; } ALC10.alcMakeContextCurrent(MainContext.Handle); for (var i = 0; i < _buffers.Count; i++) { var buf = _buffers[i]; AL10.alDeleteBuffers(_buffers.Count, ref buf); } _buffers.Clear(); ALC10.alcMakeContextCurrent(IntPtr.Zero); foreach (var ctx in _contexts) { ctx.Destroy(); } ALC10.alcCloseDevice(_handle); _disposed = true; }
public override void Dispose() { if (!IsDisposed) { base.Dispose(); // Will call Stop(true); // Delete all known buffer objects uint qBuffer; while (queuedBuffers.Count > 0) { qBuffer = queuedBuffers.Dequeue(); AL10.alDeleteBuffers((IntPtr)1, ref qBuffer); } queuedBuffers = null; while (availableBuffers.Count > 0) { qBuffer = availableBuffers.Dequeue(); AL10.alDeleteBuffers((IntPtr)1, ref qBuffer); } availableBuffers = null; while (buffersToQueue.Count > 0) { qBuffer = buffersToQueue.Dequeue(); AL10.alDeleteBuffers((IntPtr)1, ref qBuffer); } buffersToQueue = null; IsDisposed = true; } }
public void Dispose() { if (!IsDisposed) { AL10.alDeleteBuffers((IntPtr)1, ref INTERNAL_buffer); IsDisposed = true; } }
protected virtual void Dispose(bool disposing) { if (!disposed) { AL10.alDeleteBuffers(1, ref buffer); disposed = true; } }
public void DeleteBuffer(IALBuffer buffer) { uint handle = (buffer as OpenALBuffer).Handle; AL10.alDeleteBuffers(1, ref handle); #if VERBOSE_AL_DEBUGGING CheckALError(); #endif }
protected override void Dispose(bool disposeManagedResources) { if (_handle > 0) { AL10.alDeleteBuffers(1, ref _handle); AudioSystem.alCheckError(); _handle = 0; } base.Dispose(disposeManagedResources); }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } AL10.alDeleteBuffers(1, new[] { Buffer }); Check(); _disposed = true; }
/// <summary> /// Delete a buffer. /// </summary> /// <param name="name">Name of the buffer.</param> /// <exception cref="InvalidOperationException">If the buffer is not owned by this device.</exception> public void DeleteBuffer(uint name) { CheckDisposed(); if (!_buffers.Remove(name)) { throw new InvalidOperationException("Device does not own given buffer."); } ALC10.alcMakeContextCurrent(MainContext.Handle); AL10.alDeleteBuffers(1, ref name); AlHelper.AlCheckError("alDeleteBuffers call failed."); }
private void dispose(bool disposing) { if (!_isDisposed) { if (_handle != 0 && !AudioEngine.IsShutdown) { AL10.alDeleteBuffers(1, ref _handle); ALUtils.CheckALError("unable to destroy sound buffer"); _handle = 0; } _isDisposed = true; } }
/// <summary> /// Delete a collection of buffers. /// </summary> /// <param name="buffers">Array to delete buffers from, starting at index 0.</param> /// <param name="n">Number of buffers to delete.</param> /// <remarks> /// Buffers that are not owned by this device are ignored. /// </remarks> /// <exception cref="IndexOutOfRangeException"> /// If <paramref name="n"/> is larger than or equal to <code>buffers.Length</code>. /// </exception> public void DeleteBuffers(uint[] buffers, int n) { CheckDisposed(); ALC10.alcMakeContextCurrent(MainContext.Handle); for (var i = 0; i < n; i++) { var buffer = buffers[i]; if (_buffers.Remove(buffer)) { AL10.alDeleteBuffers(1, ref buffer); } } AlHelper.AlCheckError("alDeleteBuffers call failed."); }
public void DeleteBuffer(IALBuffer buffer) { uint handle = (buffer as OpenALBuffer).Handle; AL10.alDeleteBuffers((IntPtr)1, ref handle); }