Exemplo n.º 1
0
        /// <summary>
        /// Commits any pending changes to a TextureSwapChain, and advances its current index
        /// </summary>
        /// <returns>
        /// Returns an ovrResult for which the return code is negative upon error.
        /// Failures include but aren't limited to:
        ///   - Result.TextureSwapChainFull: ovr_CommitTextureSwapChain was called too many times on a texture swapchain without calling submit to use the chain.
        /// </returns>
        public Result Commit()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException("TextureSwapChain");
            }

            return(_ovr.CommitTextureSwapChain(_sessionPtr, TextureSwapChainPtr));
        }
        public void Commit()
        {
            var result = _ovr.CommitTextureSwapChain(_sessionPtr, _textureSwapChainPtr);

            if (result < Ab3d.OculusWrap.Result.Success)
            {
                var lastError = _ovr.GetLastErrorInfo();
                throw new OvrException("Commit failed: " + lastError.ErrorString, lastError.Result);
            }

            result = _ovr.GetTextureSwapChainCurrentIndex(_sessionPtr, _textureSwapChainPtr, out _currentIndex);

            if (result < Ab3d.OculusWrap.Result.Success)
            {
                var lastError = _ovr.GetLastErrorInfo();
                throw new OvrException(lastError.ErrorString, lastError.Result);
            }
        }