diff options
-rw-r--r-- | libdimension/dimension/scene.h | 9 | ||||
-rw-r--r-- | libdimension/scene.c | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/libdimension/dimension/scene.h b/libdimension/dimension/scene.h index 12ad6bd..8c9c705 100644 --- a/libdimension/dimension/scene.h +++ b/libdimension/dimension/scene.h @@ -37,15 +37,18 @@ typedef struct { dmnsn_color background; dmnsn_texture *default_texture; - /* Objects */ - dmnsn_array *objects; - /* Camera */ dmnsn_camera *camera; /* Canvas */ dmnsn_canvas *canvas; + /* Objects */ + dmnsn_array *objects; + + /* Lights */ + dmnsn_array *lights; + /* Rendering quality */ dmnsn_quality quality; } dmnsn_scene; diff --git a/libdimension/scene.c b/libdimension/scene.c index 3629c8e..6d870fe 100644 --- a/libdimension/scene.c +++ b/libdimension/scene.c @@ -27,10 +27,12 @@ dmnsn_new_scene() { dmnsn_scene *scene = malloc(sizeof(dmnsn_scene)); if (scene) { - scene->camera = NULL; - scene->canvas = NULL; scene->default_texture = NULL; - scene->objects = dmnsn_new_array(sizeof(dmnsn_object*)); + + scene->camera = NULL; + scene->canvas = NULL; + scene->objects = dmnsn_new_array(sizeof(dmnsn_object *)); + scene->lights = dmnsn_new_array(sizeof(dmnsn_light *)); scene->quality = DMNSN_RENDER_FULL; } return scene; @@ -41,6 +43,7 @@ void dmnsn_delete_scene(dmnsn_scene *scene) { if (scene) { + dmnsn_delete_array(scene->lights); dmnsn_delete_array(scene->objects); free(scene); } |