diff --git a/src/play_clj/core.clj b/src/play_clj/core.clj index b3cf1c1..978e51a 100644 --- a/src/play_clj/core.clj +++ b/src/play_clj/core.clj @@ -166,20 +166,6 @@ handle errors and perform other custom actions each time they run. [wrapper-fn] (intern 'play-clj.core 'wrapper wrapper-fn)) -(defn set-asset-manager! - "Sets a global asset manager, which will keep track of objects that need to -be manually disposed, such as `texture` entities and `pixmap` objects. The -asset manager will then allow you to dispose them all at once. - - ; create an asset manager - (defonce manager (asset-manager)) - ; set it to be used by play-clj - (set-asset-manager! manager) - ; dispose all assets at once - (asset-manager! manager :clear)" - [am] - (intern 'play-clj.utils '*asset-manager* am)) - (defn update! "Runs the equivalent of `(swap! screen-atom assoc ...)`, where `screen-atom` is the atom storing the screen map behind the scenes. Returns the updated diff --git a/src/play_clj/core_utils.clj b/src/play_clj/core_utils.clj index 55083d5..4f1ecee 100644 --- a/src/play_clj/core_utils.clj +++ b/src/play_clj/core_utils.clj @@ -219,3 +219,17 @@ found." [object k & options] `(let [^AssetManager object# ~object] (u/call! object# ~k ~@options))) + +(defn set-asset-manager! + "Sets a global asset manager, which will keep track of objects that need to +be manually disposed, such as `texture` entities and `pixmap` objects. The +asset manager will then allow you to dispose them all at once. + + ; create an asset manager + (defonce manager (asset-manager)) + ; set it to be used by play-clj + (set-asset-manager! manager) + ; dispose all assets at once + (asset-manager! manager :clear)" + [am] + (intern 'play-clj.utils '*asset-manager* am))