mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-18 20:28:01 +00:00
clay.h: update Clay_OnHover to take void*
This commit is contained in:
parent
982ade4cf9
commit
f298e34bdc
8
clay.h
8
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.
|
// 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.
|
// - 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.
|
// - 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.
|
// 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.
|
// 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);
|
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_BoundingBox boundingBox;
|
||||||
Clay_ElementId elementId;
|
Clay_ElementId elementId;
|
||||||
Clay_LayoutElement* layoutElement;
|
Clay_LayoutElement* layoutElement;
|
||||||
void (*onHoverFunction)(Clay_ElementId elementId, Clay_PointerData pointerInfo, intptr_t userData);
|
void (*onHoverFunction)(Clay_ElementId elementId, Clay_PointerData pointerInfo, void *userData);
|
||||||
intptr_t hoverFunctionUserData;
|
void *hoverFunctionUserData;
|
||||||
int32_t nextIndex;
|
int32_t nextIndex;
|
||||||
uint32_t generation;
|
uint32_t generation;
|
||||||
uint32_t idAlias;
|
uint32_t idAlias;
|
||||||
@ -3976,7 +3976,7 @@ bool Clay_Hovered(void) {
|
|||||||
return false;
|
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();
|
Clay_Context* context = Clay_GetCurrentContext();
|
||||||
if (context->booleanWarnings.maxElementsExceeded) {
|
if (context->booleanWarnings.maxElementsExceeded) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user