summaryrefslogtreecommitdiffstats
path: root/tests/raytrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/raytrace.c')
-rw-r--r--tests/raytrace.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/raytrace.c b/tests/raytrace.c
index 4d54e1c..0515ab2 100644
--- a/tests/raytrace.c
+++ b/tests/raytrace.c
@@ -30,13 +30,22 @@ main() {
/* Set the resilience low for tests */
dmnsn_set_resilience(DMNSN_SEVERITY_LOW);
- /* Allocate our new scene */
+ /* Allocate our default scene */
scene = dmnsn_new_default_scene();
if (!scene) {
fprintf(stderr, "--- Allocation of default scene failed! ---\n");
return EXIT_FAILURE;
}
+ /* Optimize the canvas for PNG export */
+ if (dmnsn_png_optimize_canvas(canvas) != 0) {
+ dmnsn_delete_canvas(canvas);
+ fprintf(stderr, "--- Couldn't optimize canvas for PNG! ---\n");
+ return EXIT_FAILURE;
+ }
+
+ /* Render scene */
+
progress = dmnsn_raytrace_scene_async(scene);
if (!progress) {
dmnsn_delete_default_scene(scene);
@@ -52,6 +61,8 @@ main() {
return EXIT_FAILURE;
}
+ /* Write the image to PNG */
+
file = fopen("raytrace.png", "wb");
if (!file) {
dmnsn_delete_default_scene(scene);