diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-16 01:16:09 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-16 01:16:09 +0000 |
commit | 8f01c5394dcce8f5d4e7102dacfcdea9d1f7b021 (patch) | |
tree | 4092a281882e34ac53ec15d582dcbf2cb0d408c0 /libdimension/dimension/camera.h | |
parent | 1928016fe7aa439d4bfb61d3a7e7b7399ca7a229 (diff) | |
download | dimension-8f01c5394dcce8f5d4e7102dacfcdea9d1f7b021.tar.xz |
Add destructor callbacks for polymorphic C types, and use their base
dmnsn_delete_*() function.
Diffstat (limited to 'libdimension/dimension/camera.h')
-rw-r--r-- | libdimension/dimension/camera.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libdimension/dimension/camera.h b/libdimension/dimension/camera.h index 13c03b0..3e6da4f 100644 --- a/libdimension/dimension/camera.h +++ b/libdimension/dimension/camera.h @@ -34,20 +34,15 @@ typedef dmnsn_line dmnsn_camera_ray_fn(const dmnsn_camera *camera, unsigned int x, unsigned int y); struct dmnsn_camera { + /* Callback functions */ + dmnsn_camera_ray_fn *ray_fn; + dmnsn_free_fn *free_fn; + /* Generic pointer for camera info */ void *ptr; - - /* Callback function */ - dmnsn_camera_ray_fn *ray_fn; }; dmnsn_camera *dmnsn_new_camera(); void dmnsn_delete_camera(dmnsn_camera *camera); -/* A perspective camera, at the origin, looking at (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 transformation matrix `trans'. */ -dmnsn_camera *dmnsn_new_perspective_camera(dmnsn_matrix trans); -void dmnsn_delete_perspective_camera(dmnsn_camera *camera); - #endif /* DIMENSION_CAMERA_H */ |