diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2014-08-19 17:10:03 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2015-10-25 11:03:56 -0400 |
commit | 7b09710392d35fb55b52031d447a542d99fc6b4b (patch) | |
tree | 270eb927ee8c52ceeb99926ebf4843704775a610 /libdimension-python | |
parent | 200c86b91ea7063d35be3bffc11c5da53c054653 (diff) | |
download | dimension-7b09710392d35fb55b52031d447a542d99fc6b4b.tar.xz |
Modularize the libdimension codebase.
Diffstat (limited to 'libdimension-python')
-rw-r--r-- | libdimension-python/dimension.pxd | 4 | ||||
-rw-r--r-- | libdimension-python/dimension.pyx | 8 | ||||
-rwxr-xr-x | libdimension-python/tests/demo.py | 5 |
3 files changed, 8 insertions, 9 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd index df291a6..cb152be 100644 --- a/libdimension-python/dimension.pxd +++ b/libdimension-python/dimension.pxd @@ -403,8 +403,8 @@ cdef extern from "../libdimension/dimension.h": dmnsn_scene *dmnsn_new_scene(dmnsn_pool *pool) - void dmnsn_ray_trace(dmnsn_scene *scene) - dmnsn_future *dmnsn_ray_trace_async(dmnsn_scene *scene) + void dmnsn_render(dmnsn_scene *scene) + dmnsn_future *dmnsn_render_async(dmnsn_scene *scene) cdef extern from "platform.h": unsigned int dmnsn_terminal_width() diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx index 2bdcc64..34d720e 100644 --- a/libdimension-python/dimension.pyx +++ b/libdimension-python/dimension.pyx @@ -1608,10 +1608,10 @@ cdef class Scene: def __get__(self): return _Timer(self._scene.render_timer) - def ray_trace(self): + def render(self): """Render the scene.""" - self.ray_trace_async().join() - def ray_trace_async(self): + self.render_async().join() + def render_async(self): """Render the scene, in the background.""" # Account for image dimensions in the camera # Do this here so subregion renders can tell us the broader image size @@ -1628,7 +1628,7 @@ cdef class Scene: # Ensure the default texture is complete cdef Texture default = Texture(pigment = Black) dmnsn_texture_cascade(default._texture, &self._scene.default_texture) - return _Future(dmnsn_ray_trace_async(self._scene)) + return _Future(dmnsn_render_async(self._scene)) def _quality_to_string(int quality): cdef str s = "" diff --git a/libdimension-python/tests/demo.py b/libdimension-python/tests/demo.py index d290a7f..2110606 100755 --- a/libdimension-python/tests/demo.py +++ b/libdimension-python/tests/demo.py @@ -49,12 +49,11 @@ scene = Scene(canvas = canvas, objects = objects, lights = lights, camera = camera) -scene.default_texture = Texture(finish = Ambient(sRGB(0.1)) - + Diffuse(sRGB(0.7))) +scene.default_texture = Texture(finish = Ambient(sRGB(0.1)) + Diffuse(sRGB(0.7))) scene.background = background scene.adc_bailout = 1/255 scene.recursion_limit = 5 -scene.ray_trace() +scene.render() if have_PNG: canvas.write_PNG("demo.png") |