mirror of
https://github.com/nicbarker/clay.git
synced 2026-02-06 12:48:49 +00:00
Merge af3d63ad0f into 76ec3632d8
This commit is contained in:
commit
382b804eda
2 changed files with 18 additions and 0 deletions
9
clay.h
9
clay.h
|
|
@ -837,6 +837,9 @@ CLAY_DLL_EXPORT Clay_Arena Clay_CreateArenaWithCapacityAndMemory(size_t capacity
|
|||
// Sets the state of the "pointer" (i.e. the mouse or touch) in Clay's internal data. Used for detecting and responding to mouse events in the debug view,
|
||||
// as well as for Clay_Hovered() and scroll element handling.
|
||||
CLAY_DLL_EXPORT void Clay_SetPointerState(Clay_Vector2 position, bool pointerDown);
|
||||
// Gets the state of the "pointer". This will return the position provided by `Clay_SetPointerState`
|
||||
// and the frame pressed state.
|
||||
CLAY_DLL_EXPORT Clay_PointerData Clay_GetPointerState();
|
||||
// Initialize Clay's internal arena and setup required data before layout can begin. Only needs to be called once.
|
||||
// - arena can be created using Clay_CreateArenaWithCapacityAndMemory()
|
||||
// - layoutDimensions are the initial bounding dimensions of the layout (i.e. the screen width and height for a full screen layout)
|
||||
|
|
@ -4037,6 +4040,12 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
|
|||
}
|
||||
}
|
||||
|
||||
CLAY_WASM_EXPORT("Clay_GetPointerState")
|
||||
Clay_PointerData Clay_GetPointerState() {
|
||||
Clay_Context* context = Clay_GetCurrentContext();
|
||||
return context->pointerInfo;
|
||||
}
|
||||
|
||||
CLAY_WASM_EXPORT("Clay_Initialize")
|
||||
Clay_Context* Clay_Initialize(Clay_Arena arena, Clay_Dimensions layoutDimensions, Clay_ErrorHandler errorHandler) {
|
||||
// Cacheline align memory passed in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue