summaryrefslogtreecommitdiffstats
path: root/libdimension-python
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-05-30 17:42:14 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-05-30 17:42:34 -0400
commitc2b4dcc7660407f687604afe2c03eff0a4ff3a16 (patch)
tree0c2448810fd79aa3ab9b71f627032f18e031db20 /libdimension-python
parent45e219eac23ea4a8181f68300fed693d9ac361a0 (diff)
downloaddimension-c2b4dcc7660407f687604afe2c03eff0a4ff3a16.tar.xz
camera: Use pool.
Diffstat (limited to 'libdimension-python')
-rw-r--r--libdimension-python/dimension.pxd6
-rw-r--r--libdimension-python/dimension.pyx6
2 files changed, 3 insertions, 9 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd
index 6b5c77f..55c2ab8 100644
--- a/libdimension-python/dimension.pxd
+++ b/libdimension-python/dimension.pxd
@@ -204,7 +204,6 @@ cdef extern from "../libdimension/dimension.h":
size_t height
dmnsn_canvas *dmnsn_new_canvas(dmnsn_pool *pool, size_t width, size_t height)
- void dmnsn_delete_canvas(dmnsn_canvas *canvas)
dmnsn_tcolor dmnsn_canvas_get_pixel(dmnsn_canvas *canvas, size_t x, size_t y)
void dmnsn_canvas_set_pixel(dmnsn_canvas *canvas, size_t x, size_t y,
@@ -373,10 +372,9 @@ cdef extern from "../libdimension/dimension.h":
ctypedef struct dmnsn_camera:
dmnsn_matrix trans
- dmnsn_camera *dmnsn_new_camera()
- void dmnsn_delete_camera(dmnsn_camera *camera)
+ dmnsn_camera *dmnsn_new_camera(dmnsn_pool *pool)
- dmnsn_camera *dmnsn_new_perspective_camera()
+ dmnsn_camera *dmnsn_new_perspective_camera(dmnsn_pool *pool)
##########
# Scenes #
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx
index 79e4014..28392db 100644
--- a/libdimension-python/dimension.pyx
+++ b/libdimension-python/dimension.pyx
@@ -1446,9 +1446,6 @@ cdef class Camera(_Transformable):
if self._camera == NULL:
raise TypeError("attempt to initialize base Camera")
- def __dealloc__(self):
- dmnsn_delete_camera(self._camera)
-
def transform(self, Matrix trans not None):
"""Transform a camera."""
self._camera.trans = dmnsn_matrix_mul(trans._m, self._camera.trans)
@@ -1467,7 +1464,7 @@ cdef class PerspectiveCamera(Camera):
sky -- the direction of the top of the camera (default: Y)
angle -- the field of view angle (from bottom to top) (default: 45)
"""
- self._camera = dmnsn_new_perspective_camera()
+ self._camera = dmnsn_new_perspective_camera(_get_pool())
Camera.__init__(self)
# Apply the field of view angle
@@ -1528,7 +1525,6 @@ cdef class Scene:
dmnsn_array_push(self._scene.lights, &l)
self._scene.camera = camera._camera
- DMNSN_INCREF(self._scene.camera)
# Subregion render support
property region_x: