Files
sbox-public/engine/Sandbox.Engine/Systems/UI/Render/BoxDrawDescriptor.cs
Antoine Pilote a582fd6f7a UI Batching (#4372)
New UI rendering that groups multiple panels to be grouped into a single draw call when possible.

New custom rendering API for custom panels using `Panel.Draw.XX` to emit drawing commands.
2026-04-14 16:06:41 -07:00

36 lines
1.0 KiB
C#

using Sandbox.Rendering;
namespace Sandbox.UI;
public record struct BoxDrawDescriptor( Rect PanelRect, Color Color )
{
public Vector4 BorderRadius;
public Vector4 BorderSize;
public Color BorderColorL;
public Color BorderColorT;
public Color BorderColorR;
public Color BorderColorB;
public Texture BackgroundImage;
public Vector4 BackgroundRect;
public Color BackgroundTint;
public float BackgroundAngle;
public BackgroundRepeat BackgroundRepeat;
public FilterMode FilterMode;
internal BlendMode BackgroundBlendMode;
internal BlendMode OverrideBlendMode;
internal Texture BorderImageTexture;
internal Vector4 BorderImageSlice;
internal BorderImageRepeat BorderImageRepeat;
internal BorderImageFill BorderImageFill;
internal Color BorderImageTint;
internal bool PremultiplyAlpha;
internal bool HasImage => BackgroundImage != null && BackgroundImage != Texture.Invalid;
internal bool HasBorderImage => BorderImageTexture != null;
internal bool IsTwoPass => HasImage && BackgroundBlendMode != BlendMode.Normal;
}