CSharpGL.Buffer.DumpBufferTexture C# (CSharp) Method

DumpBufferTexture() public method

Dump a Texture filled with this Buffer.
public DumpBufferTexture ( uint internalFormat, bool autoDispose ) : Texture
internalFormat uint
autoDispose bool Dispose this buffer when disposing returned texture.
return Texture
        public Texture DumpBufferTexture(uint internalFormat, bool autoDispose)
        {
            var texture = new Texture(TextureTarget.TextureBuffer,
                new TexBufferImageFiller(internalFormat, this, autoDispose),
                new NullSampler());
            texture.Initialize();
            return texture;
        }

Usage Example

 /// <summary>
 ///
 /// </summary>
 /// <param name="internalFormat"></param>
 /// <param name="buffer"></param>
 /// <param name="autoDispose">Dispose <paramref name="buffer"/> when disposing returned texture.</param>
 /// <returns></returns>
 public static Texture CreateBufferTexture(uint internalFormat, Buffer buffer, bool autoDispose)
 {
     return(buffer.DumpBufferTexture(internalFormat, autoDispose));
 }