summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
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/dimension
parent45e219eac23ea4a8181f68300fed693d9ac361a0 (diff)
downloaddimension-c2b4dcc7660407f687604afe2c03eff0a4ff3a16.tar.xz
camera: Use pool.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/camera.h18
-rw-r--r--libdimension/dimension/cameras.h5
2 files changed, 5 insertions, 18 deletions
diff --git a/libdimension/dimension/camera.h b/libdimension/dimension/camera.h
index e94e227..3c6494c 100644
--- a/libdimension/dimension/camera.h
+++ b/libdimension/dimension/camera.h
@@ -36,28 +36,20 @@ typedef struct dmnsn_camera dmnsn_camera;
typedef dmnsn_line dmnsn_camera_ray_fn(const dmnsn_camera *camera,
double x, double y);
-/**
- * Camera destruction callback.
- * @param[in,out] camera The camera to delete.
- */
-typedef void dmnsn_camera_free_fn(dmnsn_camera *camera);
-
/** A camera. */
struct dmnsn_camera {
/* Callback functions */
dmnsn_camera_ray_fn *ray_fn; /**< Camera ray callback. */
- dmnsn_camera_free_fn *free_fn; /**< Destructor callback. */
dmnsn_matrix trans; /**< Transformation matrix. */
-
- DMNSN_REFCOUNT; /**< Reference count. */
};
/**
* Create a dummy camera.
+ * @param[in] pool The memory pool to allocate from.
* @return The allocated camera.
*/
-dmnsn_camera *dmnsn_new_camera(void);
+dmnsn_camera *dmnsn_new_camera(dmnsn_pool *pool);
/**
* Initialize a dmnsn_camera field.
@@ -66,12 +58,6 @@ dmnsn_camera *dmnsn_new_camera(void);
void dmnsn_init_camera(dmnsn_camera *camera);
/**
- * Delete a camera.
- * @param[in,out] camera The camera to delete.
- */
-void dmnsn_delete_camera(dmnsn_camera *camera);
-
-/**
* Invoke the camera ray callback, then correctly transform the ray.
* @param[in] camera The camera itself.
* @param[in] x The x coordinate of the pixel (in [0, 1]).
diff --git a/libdimension/dimension/cameras.h b/libdimension/dimension/cameras.h
index d7f44b2..9ef2646 100644
--- a/libdimension/dimension/cameras.h
+++ b/libdimension/dimension/cameras.h
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (C) 2009-2010 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2009-2014 Tavian Barnes <tavianator@tavianator.com> *
* *
* This file is part of The Dimension Library. *
* *
@@ -28,6 +28,7 @@
* (0, 0, 1). The feild of view is the section of the plane z = 1 from
* (-0.5, -0.5) to (0.5, 0.5). Rays are transformed by the camera's
* transformation matrix.
+ * @param[in] pool The memory pool to allocate from.
* @return A perspective camera.
*/
-dmnsn_camera *dmnsn_new_perspective_camera(void);
+dmnsn_camera *dmnsn_new_perspective_camera(dmnsn_pool *pool);