From f298e34bdc28f66021457ca0a3f1574c0db72582 Mon Sep 17 00:00:00 2001 From: TotallyGamerJet Date: Thu, 20 Mar 2025 10:45:44 -0400 Subject: [PATCH] clay.h: update Clay_OnHover to take void* --- clay.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clay.h b/clay.h index ca0d5a4..23841dc 100644 --- a/clay.h +++ b/clay.h @@ -841,7 +841,7 @@ CLAY_DLL_EXPORT bool Clay_Hovered(void); // Bind a callback that will be called when the pointer position provided by Clay_SetPointerState is within the current element's bounding box. // - onHoverFunction is a function pointer to a user defined function. // - userData is a pointer that will be transparently passed through when the onHoverFunction is called. -CLAY_DLL_EXPORT void Clay_OnHover(void (*onHoverFunction)(Clay_ElementId elementId, Clay_PointerData pointerData, intptr_t userData), intptr_t userData); +CLAY_DLL_EXPORT void Clay_OnHover(void (*onHoverFunction)(Clay_ElementId elementId, Clay_PointerData pointerData, void *userData), void *userData); // An imperative function that returns true if the pointer position provided by Clay_SetPointerState is within the element with the provided ID's bounding box. // This ID can be calculated either with CLAY_ID() for string literal IDs, or Clay_GetElementId for dynamic strings. CLAY_DLL_EXPORT bool Clay_PointerOver(Clay_ElementId elementId); @@ -1134,8 +1134,8 @@ typedef struct { // todo get this struct into a single cache line Clay_BoundingBox boundingBox; Clay_ElementId elementId; Clay_LayoutElement* layoutElement; - void (*onHoverFunction)(Clay_ElementId elementId, Clay_PointerData pointerInfo, intptr_t userData); - intptr_t hoverFunctionUserData; + void (*onHoverFunction)(Clay_ElementId elementId, Clay_PointerData pointerInfo, void *userData); + void *hoverFunctionUserData; int32_t nextIndex; uint32_t generation; uint32_t idAlias; @@ -3976,7 +3976,7 @@ bool Clay_Hovered(void) { return false; } -void Clay_OnHover(void (*onHoverFunction)(Clay_ElementId elementId, Clay_PointerData pointerInfo, intptr_t userData), intptr_t userData) { +void Clay_OnHover(void (*onHoverFunction)(Clay_ElementId elementId, Clay_PointerData pointerInfo, void *userData), void *userData) { Clay_Context* context = Clay_GetCurrentContext(); if (context->booleanWarnings.maxElementsExceeded) { return;