Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
nicbarker committed Dec 20, 2024
2 parents b3ca260 + b2dba60 commit 40d378e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void HandleButtonInteraction(Clay_ElementId elementId, Clay_PointerData pointerI
ButtonData linkButton = (ButtonData) { .link = "https://github.com/nicbarker/clay" };
// HandleButtonInteraction will be called for each frame the mouse / pointer / touch is inside the button boundaries
CLAY(CLAY_LAYOUT({ .padding = { 8, 8 }}), Clay_OnHover(HandleButtonInteraction, &buttonData)) {
CLAY(CLAY_LAYOUT({ .padding = { 8, 8 }}), Clay_OnHover(HandleButtonInteraction, &linkButton)) {
CLAY_TEXT(CLAY_STRING("Button"), &headerTextConfig);
}
```
Expand Down
6 changes: 3 additions & 3 deletions clay.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#define CLAY__CONFIG_WRAPPER(type, ...) (type) __VA_ARGS__
#endif

#define CLAY__MAX(x, y) (((x) > (y)) ? (x) : (y))
#define CLAY__MIN(x, y) (((x) < (y)) ? (x) : (y))

#define CLAY_LAYOUT(...) Clay__AttachLayoutConfig(Clay__StoreLayoutConfig(CLAY__CONFIG_WRAPPER(Clay_LayoutConfig, __VA_ARGS__)))

#define CLAY_RECTANGLE(...) Clay__AttachElementConfig(CLAY__CONFIG_WRAPPER(Clay_ElementConfigUnion, { .rectangleElementConfig = Clay__StoreRectangleElementConfig(CLAY__INIT(Clay_RectangleElementConfig) __VA_ARGS__) }, CLAY__ELEMENT_CONFIG_TYPE_RECTANGLE))
Expand Down Expand Up @@ -515,9 +518,6 @@ extern bool Clay__debugMaxElementsLatch;
#define CLAY__MAXFLOAT 3.40282346638528859812e+38F
#endif

#define CLAY__MAX(x, y) (((x) > (y)) ? (x) : (y))
#define CLAY__MIN(x, y) (((x) < (y)) ? (x) : (y))

bool Clay__warningsEnabled = true;

void Clay__Noop() {};
Expand Down
2 changes: 1 addition & 1 deletion examples/raylib-sidebar-scrolling-container/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ int main(void) {
Clay_Arena clayMemory = (Clay_Arena) { .label = CLAY_STRING("Clay Memory Arena"), .memory = malloc(totalMemorySize), .capacity = totalMemorySize };
Clay_SetMeasureTextFunction(Raylib_MeasureText);
Clay_Initialize(clayMemory, (Clay_Dimensions) { (float)GetScreenWidth(), (float)GetScreenHeight() });
Clay_Raylib_Initialize(FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI | FLAG_MSAA_4X_HINT);
Clay_Raylib_Initialize(1024, 768, "Clay - Raylib Renderer Example", FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI | FLAG_MSAA_4X_HINT);
profilePicture = LoadTextureFromImage(LoadImage("resources/profile-picture.png"));
Raylib_fonts[FONT_ID_BODY_24] = (Raylib_Font) {
.font = LoadFontEx("resources/Roboto-Regular.ttf", 48, 0, 400),
Expand Down
6 changes: 3 additions & 3 deletions renderers/raylib/clay_renderer_raylib.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ static inline Clay_Dimensions Raylib_MeasureText(Clay_String *text, Clay_TextEle
return textSize;
}

void Clay_Raylib_Initialize(unsigned int flags) {
void Clay_Raylib_Initialize(int width, int height, const char *title, unsigned int flags) {
SetConfigFlags(flags);
InitWindow(1024, 768, "Clay - Raylib Renderer Example");
InitWindow(width, height, title);
// EnableEventWaiting();
}

Expand Down Expand Up @@ -236,4 +236,4 @@ void Clay_Raylib_Render(Clay_RenderCommandArray renderCommands)
}
}
}
}
}

0 comments on commit 40d378e

Please sign in to comment.