Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Buffer" /> class.
 /// </summary>
 /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
 /// <param name="description">The description.</param>
 /// <param name="bufferFlags">Type of the buffer.</param>
 /// <param name="viewFormat">The view format.</param>
 /// <param name="dataPointer">The data pointer.</param>
 protected Buffer(GraphicsDevice device, BufferDescription description, BufferFlags bufferFlags, PixelFormat viewFormat, IntPtr dataPointer) : base(device)
 {
     Description = description;
     BufferFlags = bufferFlags;
     ViewFormat = viewFormat;
     //InitCountAndViewFormat(out this.elementCount, ref ViewFormat);
     //Initialize(device.RootDevice, null);
 }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Buffer" /> class.
        /// </summary>
        /// <param name="description">The description.</param>
        /// <param name="viewFlags">Type of the buffer.</param>
        /// <param name="viewFormat">The view format.</param>
        /// <param name="dataPointer">The data pointer.</param>
        protected Buffer InitializeFromImpl(BufferDescription description, BufferFlags viewFlags, PixelFormat viewFormat, IntPtr dataPointer)
        {
            bufferDescription = description;
            ViewFlags = viewFlags;

#if !SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGLES
            int pixelSize;
            bool isCompressed;
            OpenGLConvertExtensions.ConvertPixelFormat(GraphicsDevice, ref viewFormat, out internalFormat, out glPixelFormat, out type, out pixelSize, out isCompressed);
#endif
            ViewFormat = viewFormat;

            Recreate(dataPointer);

            return this;
        }
Пример #3
0
 /// <summary>
 /// Creates a tempoary buffer.
 /// </summary>
 /// <param name="description">The description.</param>
 /// <returns>Buffer.</returns>
 protected virtual Buffer CreateBuffer(BufferDescription description)
 {
     return(Buffer.New(GraphicsDevice, description));
 }