Download Tutorial C Files H Files

dg_scene_add_ent

This function is used to add an entity to a scene.

Usage

void dg_scene_add_ent(dg_scene_t *scene, dg_entity_t *entity);

Example

dg_scene_add_ent(scene, dg_ent_player());

Source code

void dg_scene_add_ent(dg_scene_t *scene, dg_entity_t *entity)
{
    if (!scene || !entity)
        return;
    dg_arr_add_begin(&(scene->entities), entity);
}