This commit is contained in:
Matej Dedina 2026-07-23 12:24:12 +00:00 committed by GitHub
commit 0a8e33dfb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,7 +12,8 @@ Camera Raylib_camera;
typedef enum
{
CUSTOM_LAYOUT_ELEMENT_TYPE_3D_MODEL
CUSTOM_LAYOUT_ELEMENT_TYPE_3D_MODEL,
CUSTOM_LAYOUT_ELEMENT_TYPE_GENERIC,
} CustomLayoutElementType;
typedef struct
@ -23,11 +24,18 @@ typedef struct
Matrix rotation;
} CustomLayoutElement_3DModel;
typedef struct
{
void (*procedure) (Clay_RenderCommandArray *renderCommands, int32_t index, void * arguments);
void * arguments;
} CustomLayoutElement_Generic;
typedef struct
{
CustomLayoutElementType type;
union {
CustomLayoutElement_3DModel model;
CustomLayoutElement_Generic function;
} customData;
} CustomLayoutElement;
@ -308,6 +316,11 @@ void Clay_Raylib_Render(Clay_RenderCommandArray renderCommands, Font* fonts)
EndMode3D();
break;
}
case CUSTOM_LAYOUT_ELEMENT_TYPE_GENERIC: {
CustomLayoutElement_Generic customFunction = customElement->customData.function;
customFunction.procedure(&renderCommands, j, customFunction.arguments);
break;
}
default: break;
}
break;