Skip to content
modkitv0.2

clay.h

#include <modkit/clay.h>9 functions · 3 structs · 5 typedefs · 1 macros

Optional Clay v0.14 layout bridge.

This header intentionally re-exports upstream Clay. Include it explicitly when using Clay's public types and declarative macros.

Functions

mk_clay_begin_layoutfunction

bool mk_clay_begin_layout(mk_clay_t clay, const mk_clay_frame_desc *frame)

Begin a wrapper layout.

A null frame descriptor reads the main window, mouse, scroll, and frame delta. The matching end call restores the Clay context that was active before this call.

ParameterTypeDescription
claymk_clay_tValue for clay.
frameconst mk_clay_frame_desc *Value for frame.

Returns True when the operation succeeds.

mk_clay_contextfunction

Clay_Context * mk_clay_context(mk_clay_t clay)

Perform the clay context operation.

ParameterTypeDescription
claymk_clay_tValue for clay.

Returns A borrowed pointer, or NULL when unavailable.

mk_clay_createfunction

mk_clay_t mk_clay_create(const mk_clay_desc *desc)

Create clay.

ParameterTypeDescription
descconst mk_clay_desc *Configuration descriptor.

Returns The resulting handle or value.

mk_clay_desc_initfunction

mk_clay_desc mk_clay_desc_init(void)

Initialize the clay desc.

Returns The resulting value.

mk_clay_destroyfunction

void mk_clay_destroy(mk_clay_t clay)

Destroy the clay.

ParameterTypeDescription
claymk_clay_tValue for clay.

mk_clay_end_layoutfunction

Clay_RenderCommandArray mk_clay_end_layout(mk_clay_t clay)

End layout.

ParameterTypeDescription
claymk_clay_tValue for clay.

Returns The resulting value.

mk_clay_renderfunction

bool mk_clay_render(mk_clay_t clay, Clay_RenderCommandArray commands)

Render an emitted Clay command array through the active Modkit pass.

Commands retain Clay's painter order across Canvas and font batches.

ParameterTypeDescription
claymk_clay_tValue for clay.
commandsClay_RenderCommandArrayValue for commands.

Returns True when the operation succeeds.

mk_clay_reset_text_cachefunction

void mk_clay_reset_text_cache(mk_clay_t clay)

Reset the text cache for the clay.

ParameterTypeDescription
claymk_clay_tValue for clay.

mk_clay_set_fontfunction

bool mk_clay_set_font(mk_clay_t clay, uint16_t font_id, mk_font_t font)

Set font on the clay.

ParameterTypeDescription
claymk_clay_tValue for clay.
font_iduint16_tValue for font ID.
fontmk_font_tValue for font.

Returns True when the operation succeeds.

Structs

mk_clay_descstruct

Data for clay desc.

FieldTypeDescription
arena_capacitysize_tThe arena capacity.
max_element_countint32_tThe max element count.
max_measure_text_cache_word_countint32_tThe max measure text cache word count.
custom_command_callbackmk_clay_custom_command_callbackThe custom command callback.
user_datavoid *The user data.

mk_clay_frame_descstruct

Data for clay frame desc.

FieldTypeDescription
widthfloatThe width.
heightfloatThe height.
pointer_xfloatThe pointer x.
pointer_yfloatThe pointer y.
pointer_downboolThe pointer down.
scroll_xfloatThe scroll x.
scroll_yfloatThe scroll y.
delta_timefloatThe delta time.
enable_drag_scrollingboolThe enable drag scrolling.

mk_clay_imagestruct

Data for clay image.

FieldTypeDescription
texturemk_texture_tThe texture.
uvmk_rectfThe UV.
tintuint32_tThe tint.

Typedefs

mk_clay_custom_command_callbacktypedef

typedef void(*) mk_clay_custom_command_callback(mk_canvas_t canvas, const Clay_RenderCommand *command, void *user_data)

Callback used for clay custom command callback.

mk_clay_desctypedef

typedef struct mk_clay_desc mk_clay_desc

Data for clay desc.

mk_clay_frame_desctypedef

typedef struct mk_clay_frame_desc mk_clay_frame_desc

Data for clay frame desc.

mk_clay_image_ttypedef

typedef struct mk_clay_image mk_clay_image_t

Data for clay image.

mk_clay_ttypedef

typedef struct mk_clay* mk_clay_t

Type used for clay.

Macros

MK_CLAY_INVALIDdefine

MK_CLAY_INVALID

Invalid sentinel for clay.