From 986fc91fe4b95d0b4f7954457feb9c1d54ddad71 Mon Sep 17 00:00:00 2001 From: oakes Date: Tue, 8 Apr 2014 14:16:24 -0400 Subject: [PATCH] Add warnings about disposing from memory --- src/play_clj/core_basics.clj | 2 ++ src/play_clj/core_graphics.clj | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/play_clj/core_basics.clj b/src/play_clj/core_basics.clj index afb5659..c0ba8e6 100644 --- a/src/play_clj/core_basics.clj +++ b/src/play_clj/core_basics.clj @@ -141,6 +141,8 @@ (defmacro sound "Returns a [Sound](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/audio/Sound.html). +When no longer needed, you must call `(sound! object :dispose)` to free it from +memory. (sound \"playerhurt.wav\") (sound \"playerhurt.wav\" :play)" diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index 49f4623..c866b3b 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -2,6 +2,8 @@ (defmacro pixmap "Returns a [Pixmap](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Pixmap.html). +When no longer needed, you must call `(pixmap! object :dispose)` to free it from +memory. (pixmap \"image.png\")" [& args] @@ -10,7 +12,9 @@ `(Pixmap. ~@args))) (defmacro pixmap! - "Calls a single method on a `pixmap`." + "Calls a single method on a `pixmap`. + + (pixmap! object :dispose)" [object k & options] `(u/call! ^Pixmap ~object ~k ~@options))