2024-08-28 04:15:19 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import clay "clay-odin"
|
|
|
|
import "core:c"
|
|
|
|
import "core:fmt"
|
|
|
|
|
2024-08-28 08:39:08 +00:00
|
|
|
measureText :: proc(text: [^]clay.String, config: [^]clay.TextElementConfig) -> clay.Dimensions {
|
|
|
|
return clay.Dimensions{20, 20}
|
|
|
|
}
|
|
|
|
|
2024-08-28 04:15:19 +00:00
|
|
|
main :: proc() {
|
|
|
|
minMemorySize: c.uint32_t = clay.MinMemorySize()
|
|
|
|
memory := make([^]u8, minMemorySize)
|
|
|
|
arena: clay.Arena = clay.CreateArenaWithCapacityAndMemory(minMemorySize, memory)
|
|
|
|
clay.Initialize(arena)
|
|
|
|
clay.BeginLayout(1024, 768)
|
|
|
|
layoutConfig: clay.LayoutConfig = clay.LayoutConfig {
|
|
|
|
sizing = {width = {type = clay.SizingType.GROW}, height = {type = clay.SizingType.GROW}},
|
|
|
|
padding = {16, 16},
|
|
|
|
}
|
2024-08-28 08:39:08 +00:00
|
|
|
rectangleConfig: clay.RectangleElementConfig = clay.RectangleElementConfig {
|
2024-08-28 04:15:19 +00:00
|
|
|
cornerRadius = {topLeft = 5},
|
|
|
|
}
|
|
|
|
|
2024-08-28 08:39:08 +00:00
|
|
|
if clay.Rectangle(
|
|
|
|
1,
|
|
|
|
clay.Layout(
|
|
|
|
{
|
|
|
|
sizing = {
|
|
|
|
width = {type = clay.SizingType.GROW},
|
|
|
|
height = {type = clay.SizingType.GROW},
|
|
|
|
},
|
|
|
|
padding = {16, 16},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
clay.RectangleConfig({cornerRadius = {topLeft = 5}}),
|
|
|
|
) {
|
2024-08-28 04:15:19 +00:00
|
|
|
if clay.Rectangle(1, &layoutConfig, &rectangleConfig) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-08-28 08:39:08 +00:00
|
|
|
renderCommands: clay.ClayArray(clay.RenderCommand) = clay.EndLayout(1024, 768)
|
|
|
|
x: int = 5
|
2024-08-28 04:15:19 +00:00
|
|
|
}
|