public override void SetData(TextureUpload upload) { Debug.Assert(upload.Bounds.Width <= bounds.Width && upload.Bounds.Height <= bounds.Height); upload.Bounds = bounds; parent.SetData(upload); }
public override void SetData(TextureUpload upload) { Debug.Assert(!isDisposed); if (upload.Bounds == Rectangle.Empty) { upload.Bounds = new Rectangle(0, 0, width, height); } IsTransparent = false; uploadQueue.Enqueue(upload); GLWrapper.EnqueueTextureUpload(this); }
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); }
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); }
public override void SetData(TextureUpload upload) { if (IsDisposed) { throw new ObjectDisposedException(ToString(), "Can not set data of a disposed texture."); } if (upload.Bounds.IsEmpty) { upload.Bounds = new RectangleI(0, 0, width, height); } IsTransparent = false; bool requireUpload = uploadQueue.Count == 0; uploadQueue.Enqueue(upload); if (requireUpload) { GLWrapper.EnqueueTextureUpload(this); } }
public abstract void SetData(TextureUpload upload);