[ecs] Add a ui function pointer to components

This allows components to display themselves in the UI. Because the
component meta-data is copied into the registry, the function pointer
can be updated by systems (eg, the renderers) to display system-specific
interpretations of the component.
This commit is contained in:
Bill Currie 2023-08-08 17:02:53 +09:00
parent 44c1ef5968
commit 102a0d591b

View file

@ -42,6 +42,7 @@
*/
///@{
struct imui_ctx_s;
struct ecs_registry_s;
typedef struct component_s {
size_t size;
@ -51,6 +52,9 @@ typedef struct component_s {
uint32_t (*rangeid) (struct ecs_registry_s *reg, uint32_t ent,
uint32_t comp);
const char *name;
void (*ui) (void *comp, struct imui_ctx_s *imui_ctx,
struct ecs_registry_s *reg, uint32_t ent,
void *data);
} component_t;
#define COMPINLINE GNU89INLINE inline