summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/object.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-07-16 01:16:09 +0000
committerTavian Barnes <tavianator@gmail.com>2009-07-16 01:16:09 +0000
commit8f01c5394dcce8f5d4e7102dacfcdea9d1f7b021 (patch)
tree4092a281882e34ac53ec15d582dcbf2cb0d408c0 /libdimension/dimension/object.h
parent1928016fe7aa439d4bfb61d3a7e7b7399ca7a229 (diff)
downloaddimension-8f01c5394dcce8f5d4e7102dacfcdea9d1f7b021.tar.xz
Add destructor callbacks for polymorphic C types, and use their base
dmnsn_delete_*() function.
Diffstat (limited to 'libdimension/dimension/object.h')
-rw-r--r--libdimension/dimension/object.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libdimension/dimension/object.h b/libdimension/dimension/object.h
index 2da3ac7..901b366 100644
--- a/libdimension/dimension/object.h
+++ b/libdimension/dimension/object.h
@@ -34,7 +34,9 @@ typedef dmnsn_array *dmnsn_object_intersections_fn(const dmnsn_object *object,
typedef int dmnsn_object_inside_fn(const dmnsn_object *object,
dmnsn_vector point);
+/* dmnsn_object definition */
struct dmnsn_object {
+ /* Surface properties */
dmnsn_texture *texture;
/* Transformation matrix */
@@ -43,6 +45,7 @@ struct dmnsn_object {
/* Callback functions */
dmnsn_object_intersections_fn *intersections_fn;
dmnsn_object_inside_fn *inside_fn;
+ dmnsn_free_fn *free_fn;
/* Generic pointer for object info */
void *ptr;
@@ -50,6 +53,8 @@ struct dmnsn_object {
/* Allocate a dummy object */
dmnsn_object *dmnsn_new_object();
+
+/* Free an object */
void dmnsn_delete_object(dmnsn_object *object);
#endif /* DIMENSION_OBJECT_H */