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/object.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/object.h')
-rw-r--r-- | libdimension/dimension/object.h | 5 |
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 */ |