예제 #1
0
        public override void SetData(TextureUpload upload)
        {
            Debug.Assert(upload.Bounds.Width <= bounds.Width && upload.Bounds.Height <= bounds.Height);

            upload.Bounds = bounds;

            parent.SetData(upload);
        }
예제 #2
0
        public override void SetData(TextureUpload upload)
        {
            Debug.Assert(upload.Bounds.Width <= bounds.Width && upload.Bounds.Height <= bounds.Height);

            if (upload.Bounds.Size.IsEmpty)
            {
                upload.Bounds = bounds;
            }
            else
            {
                upload.Bounds.X += bounds.X;
                upload.Bounds.Y += bounds.Y;
            }

            parent?.SetData(upload);
        }
예제 #3
0
        public override void SetData(TextureUpload upload)
        {
            if (upload.Bounds.Width > bounds.Width || upload.Bounds.Height > bounds.Height)
            {
                throw new ArgumentOutOfRangeException($"Texture is too small to fit the requested upload. Texture size is {bounds.Width} x {bounds.Height}, upload size is {upload.Bounds.Width} x {upload.Bounds.Height}.", nameof(upload));
            }

            if (upload.Bounds.Size.IsEmpty)
            {
                upload.Bounds = bounds;
            }
            else
            {
                upload.Bounds.X += bounds.X;
                upload.Bounds.Y += bounds.Y;
            }

            parent?.SetData(upload);
        }
예제 #4
0
        public override bool Upload()
        {
            if (isDisposed)
            {
                return(false);
            }

            lock (this)
            {
                if (dataToBeUploaded != null)
                {
                    parent.SetData(dataToBeUploaded, bounds, levelToBeUploaded, formatToBeUploaded);
                    parent.Upload();
                    dataToBeUploaded = null;

                    return(true);
                }
            }

            return(false);
        }