Example #1
0
        /// <summary>
        /// Create an upload from a <see cref="TextureUpload"/>. This is the preferred method.
        /// </summary>
        /// <param name="image">The texture to upload.</param>
        public TextureUpload(Image <Rgba32> image)
        {
            this.image = image;

            if (image.Width > GLWrapper.MaxTextureSize || image.Height > GLWrapper.MaxTextureSize)
            {
                throw new TextureTooLargeForGLException();
            }

            pixelMemory = image.CreateReadOnlyPixelMemory();
        }