Пример #1
0
        /// <summary>
        /// Gets a swap chain back buffer.
        /// </summary>
        /// <param name="swapChain">The swap chain to get the buffer from.</param>
        /// <param name="index">The index of the desired buffer.</param>
        /// <returns>The buffer interface, or <c>null</c> on failure.</returns>
        public static Surface FromSwapChain(SwapChain swapChain, int index)
        {
            IntPtr surfacePointer;

            swapChain.GetBuffer(index, Utilities.GetGuidFromType(typeof(Surface)), out surfacePointer);
            return(new Surface(surfacePointer));
        }