mirror of
https://github.com/nicbarker/clay.git
synced 2026-08-03 05:39:09 +00:00
Merge 3f2d9bf055 into e6cc36941a
This commit is contained in:
commit
0a8e33dfb7
1 changed files with 14 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue