summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-05-20 13:49:41 -0600
committerTavian Barnes <tavianator@gmail.com>2011-05-20 13:49:41 -0600
commitad716acc7fa7fd151ff96fe6d17f0ba1a3a66379 (patch)
tree810d04a5e8892aaa5f82c486b272d93f6cfd50b4 /libdimension/dimension
parent5770d22635a63fb745bc0f3cd3dee573a6b356b6 (diff)
downloaddimension-ad716acc7fa7fd151ff96fe6d17f0ba1a3a66379.tar.xz
Add a refcount to canvases.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/canvas.h2
-rw-r--r--libdimension/dimension/scene.h9
2 files changed, 11 insertions, 0 deletions
diff --git a/libdimension/dimension/canvas.h b/libdimension/dimension/canvas.h
index 6938c0e..f33fc88 100644
--- a/libdimension/dimension/canvas.h
+++ b/libdimension/dimension/canvas.h
@@ -39,6 +39,8 @@ typedef struct {
* at (a,b) is accessible as pixels[b*width + a].
*/
dmnsn_color *pixels;
+
+ dmnsn_refcount *refcount; /**< @internal Reference count. */
} dmnsn_canvas;
/* Forward-declare dmnsn_canvas_optimizer */
diff --git a/libdimension/dimension/scene.h b/libdimension/dimension/scene.h
index c182d85..ffe5fb3 100644
--- a/libdimension/dimension/scene.h
+++ b/libdimension/dimension/scene.h
@@ -93,6 +93,15 @@ void dmnsn_delete_scene(dmnsn_scene *scene);
void dmnsn_initialize_scene(dmnsn_scene *scene);
/**
+ * Set the output canvas for a scene.
+ * @param[in,out] scene The scene for which to set the canvas.
+ * @param[in] canvas The canvas to set.
+ */
+void dmnsn_scene_set_canvas(dmnsn_scene *scene, dmnsn_canvas *canvas);
+
+/**
* Add an object to a scene.
+ * @param[in,out] scene The scene to which to add the object.
+ * @param[in] object The object to add.
*/
void dmnsn_scene_add_object(dmnsn_scene *scene, dmnsn_object *object);