GGUI::UIPrimitive struct

UIPrimitive: one instanced quad. 48 bytes; the layout is shared with the shaders.

Positions are in document space (UI units) before the clip entry's offset (UIClip); the surface transform is applied at draw time. Colours are sRGB with straight alpha, with inherited opacity already multiplied into the alpha; the renderer converts to linear and premultiplies. A snapshot stores primitives in slots and lists the draw order separately.

Public variables

float X
left, or a point's x (IsPointShape)
float Y
top, or a point's y
float Width
width, or a second point's x
float Height
height, or a second point's y
uint16_t U0
texture region in 65536ths; exact for power-of-two textures, 65535 = far edge
uint16_t V0
see U0
uint16_t U1
see U0
uint16_t V1
see U0
GGColor Fill
its colour
GGColor Border
its border's colour
uint8_t Radius
TL, TR, BR, BL, in half UI units.
uint8_t BorderWidth
quarter UI units
PrimitiveKind Kind
what it draws
uint16_t Clip
clip table index; 0 = unclipped
uint16_t Texture
texture table index; 0 = white
uint16_t Flags
PrimitiveFlags.
float Parameter
kind-specific: a shadow's blur in UI units; an image's greyscale (0..1); an arc's thickness