Exemplo n.º 1
0
        public static void Release()
        {
            Texture2D.Destroy(TextureDistortedLeft);
            Texture2D.Destroy(TextureDistortedRight);
            Texture2D.Destroy(TextureUndistortedLeft);
            Texture2D.Destroy(TextureUndistortedRight);
            Texture2D.Destroy(TextureDepth);

            for (int i = 0; i < UndistortedTextureDataBuffer.Count; i++)
            {
                if (UndistortedTextureDataBuffer[i].Initialized)
                {
                    Texture2D.Destroy(UndistortedTextureDataBuffer[i].Left);
                    Texture2D.Destroy(UndistortedTextureDataBuffer[i].Right);
                    UndistortedTextureDataBuffer[i].Initialized = false;
                }
            }

            UndistortedTextureDataBuffer.Clear();
            SetTextureFromHandleReady = false;
            SRWorkModule_API.ReleaseCopyD3D11TextureBuffer();

            TextureDistortedLeft    = null;
            TextureDistortedRight   = null;
            TextureUndistortedLeft  = null;
            TextureUndistortedRight = null;
            TextureDepth            = null;
        }