summaryrefslogtreecommitdiffstats
path: root/libdimension/scene.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-19 20:30:14 -0500
committerTavian Barnes <tavianator@gmail.com>2010-11-19 20:31:06 -0500
commitd47af986a7832add1c149235f44fa8f57b56e6d8 (patch)
tree40fbd4a5e84afa188c2f23a7727d3d9d2acb6840 /libdimension/scene.c
parent6137aed0179476eaa626660885f01ea3f04f988a (diff)
downloaddimension-d47af986a7832add1c149235f44fa8f57b56e6d8.tar.xz
Implement sky spheres.
Diffstat (limited to 'libdimension/scene.c')
-rw-r--r--libdimension/scene.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libdimension/scene.c b/libdimension/scene.c
index 9eca7b7..c43a93a 100644
--- a/libdimension/scene.c
+++ b/libdimension/scene.c
@@ -34,6 +34,7 @@ dmnsn_new_scene()
scene->background = dmnsn_black;
scene->ambient = dmnsn_white;
+ scene->sky_sphere = NULL;
scene->default_texture = dmnsn_new_texture();
scene->camera = NULL;
scene->canvas = NULL;
@@ -68,6 +69,19 @@ dmnsn_delete_scene(dmnsn_scene *scene)
dmnsn_delete_canvas(scene->canvas);
dmnsn_delete_camera(scene->camera);
dmnsn_delete_texture(scene->default_texture);
+ dmnsn_delete_sky_sphere(scene->sky_sphere);
dmnsn_free(scene);
}
}
+
+void
+dmnsn_scene_init(dmnsn_scene *scene)
+{
+ if (scene->sky_sphere) {
+ dmnsn_sky_sphere_init(scene->sky_sphere);
+ }
+
+ DMNSN_ARRAY_FOREACH (dmnsn_object **, object, scene->objects) {
+ dmnsn_object_init(*object);
+ }
+}