diff --git a/bindings/odin/clay-odin/clay.odin b/bindings/odin/clay-odin/clay.odin index bd604dc..5290c37 100644 --- a/bindings/odin/clay-odin/clay.odin +++ b/bindings/odin/clay-odin/clay.odin @@ -378,6 +378,7 @@ Context :: struct {} // opaque structure, only use as a pointer @(link_prefix = "Clay_", default_calling_convention = "c") foreign Clay { _OpenElement :: proc() --- + _OpenElementWithId :: proc(id: ElementId) --- _CloseElement :: proc() --- MinMemorySize :: proc() -> u32 --- CreateArenaWithCapacityAndMemory :: proc(capacity: c.size_t, offset: [^]u8) -> Arena --- @@ -426,11 +427,19 @@ ConfigureOpenElement :: proc(config: ElementDeclaration) -> bool { } @(deferred_none = _CloseElement) -UI :: proc(id: ElementId = {}) -> proc (config: ElementDeclaration) -> bool { +UI_WithId :: proc(id: ElementId) -> proc (config: ElementDeclaration) -> bool { + _OpenElementWithId(id) + return ConfigureOpenElement +} + +@(deferred_none = _CloseElement) +UI_AutoId :: proc() -> proc (config: ElementDeclaration) -> bool { _OpenElement() return ConfigureOpenElement } +UI :: proc{UI_WithId, UI_AutoId}; + Text :: proc($text: string, config: ^TextElementConfig) { wrapped := MakeString(text) wrapped.isStaticallyAllocated = true