Added in some missing Clay macros and moved re-used config declarations out of global scope into main for video-example.c3

This commit is contained in:
Jefferey Schlueter 2025-02-04 14:49:57 -05:00
parent afe52f946b
commit c133e07096
2 changed files with 321 additions and 103 deletions

View file

@ -68,18 +68,6 @@ const Document[*] ALL_DOCUMENTS = {
uint selectedDocumentIndex = 0;
RectangleElementConfig contentBackgroundConfig = {
{ 90, 90, 90, 255 },
clay::@cornerRadiusUniCT(8)
};
Sizing layoutExpand = Sizing{ clay::sizingGrow(), clay::sizingGrow() };
LayoutConfig sidebarButtonLayout = LayoutConfig{
.sizing = { .width = clay::sizingGrow() },
.padding = clay::paddingCT(16, 16, 16, 16)
};
bool isDebugModeEnabled = false;
fn void main() @public
@ -104,6 +92,21 @@ fn void main() @public
TextureFilter.BILINEAR
);
// ==============================================
// ===== predeclarations of re-used configs =====
// ==============================================
RectangleElementConfig contentBackgroundConfig = {
{ 90, 90, 90, 255 },
clay::@cornerRadiusUniCT(8)
};
Sizing layoutExpand = Sizing{ clay::sizingGrow(), clay::sizingGrow() };
LayoutConfig sidebarButtonLayout = LayoutConfig{
.sizing = { .width = clay::sizingGrow() },
.padding = clay::paddingCT(16, 16, 16, 16)
};
while (!rl::windowShouldClose()) {
clay::setLayoutDimensions({rl::getScreenWidth(), rl::getScreenHeight()});
Vector2 mouse_position = rl::getMousePosition();