Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
#if DIRECTX
                if (disposing)
                {
                    if (_resourceView != null)
                    {
                        _resourceView.Dispose();
                        _resourceView = null;
                    }

                    if (_texture != null)
                    {
                        _texture.Dispose();
                        _texture = null;
                    }
                }
#elif OPENGL
                GraphicsDevice.AddDisposeAction(() =>
                {
                    GL.DeleteTextures(1, ref glTexture);
                    GraphicsExtensions.CheckGLError();
                    glTexture = -1;
                });

                glLastSamplerState = null;
#endif
            }
            base.Dispose(disposing);
        }
Ejemplo n.º 2
0
        public override void Dispose()
        {
#if DIRECTX
            if (_resourceView != null)
            {
                _resourceView.Dispose();
                _resourceView = null;
            }

            if (_texture != null)
            {
                _texture.Dispose();
                _texture = null;
            }
#elif OPENGL
            GL.DeleteTextures(1, ref glTexture);
            GraphicsExtensions.CheckGLError();
#endif
            base.Dispose();
        }