diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-08 17:12:02 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-08 17:12:02 +0000 |
commit | bff7f2b3b440c30d0d6eb692576af57ef42edd1b (patch) | |
tree | 0ba45051db1ee7b7808339cfb587f8f76d8c7c5c /tests/raytrace.c | |
parent | 14c9cd86e1b7c6ff27c5000d72721c54a718daac (diff) | |
download | dimension-bff7f2b3b440c30d0d6eb692576af57ef42edd1b.tar.xz |
Comments and style adjustments, and a couple fixes.
Diffstat (limited to 'tests/raytrace.c')
-rw-r--r-- | tests/raytrace.c | 13 |
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); |