示例#1
0
        /// <summary>
        /// Creates a new <see cref="Buffer" /> instance.
        /// </summary>
        /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
        /// <param name="description">The description of the buffer.</param>
        /// <param name="viewFormat">View format used if the buffer is used as a shared resource view.</param>
        /// <returns>An instance of a new <see cref="Buffer" /></returns>
        public static Buffer New(GraphicsDevice device, BufferDescription description, PixelFormat viewFormat = PixelFormat.None)
        {
            var bufferType = description.BufferFlags;

            return(new Buffer(device).InitializeFromImpl(description, bufferType, viewFormat, IntPtr.Zero));
        }
示例#2
0
 /// <summary>
 /// Creates a temporary buffer.
 /// </summary>
 /// <param name="description">The description.</param>
 /// <param name="viewFormat">The shader view format on the buffer</param>
 /// <returns>Buffer.</returns>
 protected virtual Buffer CreateBuffer(BufferDescription description, PixelFormat viewFormat)
 {
     return(Buffer.New(GraphicsDevice, description, viewFormat));
 }