Download Tutorial C Files H Files

dg_scene_update

This function is used to update a scene.

Usage

void dg_scene_update(dg_scene_t *scene, dg_window_t *w, sfTime dt);

Example

dg_scene_update(scene, w, dt);

Source code

void dg_scene_update(dg_scene_t *scene, dg_window_t *w, sfTime dt)
{
    dg_array_t *tmp = 0;
    dg_array_t *sys = 0;
    dg_system_t *vsystem = 0;
    int sp_component = -1;
    sfSprite *sprite = 0;

    if (!scene)
        return;
    for (tmp = scene->entities; tmp; tmp = tmp->next) {
        for (sys = scene->systems; sys; sys = sys->next) {
            vsystem = ((dg_system_t *)(sys->data));
            vsystem->system(tmp->data, w, &(scene->entities),dt);
        }
    }
}