Download Tutorial C Files H Files

dg_entity_create

This function is used to create a component.

Usage

dg_entity_t *dg_entity_create(char *name);

Example

dg_entity_t *entity = dg_entity_create("camera");

Source code

dg_entity_t *dg_entity_create(char *name)
{
    dg_entity_t *entity = malloc(sizeof(dg_entity_t));

    if (!entity)
        return 0;
    entity->name = name;
    entity->components = 0;
    return entity;
}