/// <summary> /// Dispose managed and unmanaged resources of this instance. /// </summary> /// <param name="disposing">If disposing equals true, managed and unmanaged resources can be disposed. If disposing equals false, only unmanaged resources can be disposed. </param> private void Dispose(bool disposing) { if (this.disposedValue == false) { if (disposing) { // Dispose managed resources. } // end if // Dispose unmanaged resources. IntPtr ptr = Win32.wglGetCurrentContext(); if (ptr != IntPtr.Zero) { if (glDeleteSamplers == null) { glDeleteSamplers = OpenGL.GetDelegateFor<OpenGL.glDeleteSamplers>(); } glDeleteSamplers(1, new uint[] { this.Id }); this.Id = 0; } } // end if this.disposedValue = true; }
/// <summary> /// Dispose managed and unmanaged resources of this instance. /// </summary> /// <param name="disposing">If disposing equals true, managed and unmanaged resources can be disposed. If disposing equals false, only unmanaged resources can be disposed. </param> private void Dispose(bool disposing) { if (this.disposedValue == false) { if (disposing) { // Dispose managed resources. } // end if // Dispose unmanaged resources. IntPtr ptr = Win32.wglGetCurrentContext(); if (ptr != IntPtr.Zero) { if (glDeleteSamplers == null) { glDeleteSamplers = OpenGL.GetDelegateFor <OpenGL.glDeleteSamplers>(); } glDeleteSamplers(1, new uint[] { this.Id }); this.Id = 0; } } // end if this.disposedValue = true; } // end sub