Skip to content

Commit

Permalink
Update odin bindings for CLAY_ID_LOCAL
Browse files Browse the repository at this point in the history
  • Loading branch information
nicbarker committed Sep 28, 2024
1 parent 5e7c4c4 commit 21d9f06
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Clay_LayoutConfig sidebarItemLayout = (Clay_LayoutConfig) {
// Re-useable components are just normal functions
void SidebarItemComponent(int index) {
CLAY_RECTANGLE(CLAY_IDI("SidebarBlob", index), sidebarItemLayout, CLAY_RECTANGLE_CONFIG(.color = COLOR_ORANGE)) {};
CLAY_RECTANGLE(CLAY_IDI("SidebarBlob", index), sidebarItemLayout, CLAY_RECTANGLE_CONFIG(.color = COLOR_ORANGE)) {}
}
// An example function to begin the "root" of your layout tree
Expand Down
9 changes: 7 additions & 2 deletions bindings/odin/clay-odin/clay.odin
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ foreign Clay {
_StoreCustomElementConfig :: proc(config: CustomElementConfig) -> ^CustomElementConfig ---
_StoreScrollElementConfig :: proc(config: ScrollElementConfig) -> ^ScrollElementConfig ---
_StoreBorderElementConfig :: proc(config: BorderElementConfig) -> ^BorderElementConfig ---
_HashString :: proc(toHash: String, index: u32) -> ElementId ---
_HashString :: proc(toHash: String, index: u32, seed: u32) -> ElementId ---
_GetOpenLayoutElementId :: proc() -> u32 ---
}

@(require_results, deferred_none = _CloseElementWithChildren)
Expand Down Expand Up @@ -409,5 +410,9 @@ MakeString :: proc(label: string) -> String {
}

ID :: proc(label: string, index: u32 = 0) -> ElementId {
return _HashString(MakeString(label), index)
return _HashString(MakeString(label), index, 0)
}

IDLocal :: proc(label: string, index: u32 = 0) -> ElementId {
return _HashString(MakeString(label), index, _GetOpenLayoutElementId())
}
Binary file modified bindings/odin/clay-odin/linux/clay.a
Binary file not shown.
Binary file modified bindings/odin/clay-odin/macos-arm64/clay.a
Binary file not shown.
Binary file modified bindings/odin/clay-odin/macos/clay.a
Binary file not shown.
Binary file modified bindings/odin/clay-odin/wasm/clay.o
Binary file not shown.
Binary file modified bindings/odin/clay-odin/windows/clay.lib
Binary file not shown.

0 comments on commit 21d9f06

Please sign in to comment.