java - I look for an explanation of libgdx's asset manager -
i create asset-manager. know asset-manager "libgdx" don't wanna use libgdx because programming studying purposes. wanna understand entire program , write scratch.
now need asset-manager because ran out of memory. took @ asset-manager of libgdx pretty code , don't understood completly.
i know basic principle/idea of libgdx's asset-manager. know works hashmaps , in own thread asyncron. pretty know.
could me?
there isn't more know, other it's using maps store , retrieve assets.
basically have this:
class assetmanager { private map<string, object> assets = new hashmap<string, object>(); public void storeasset(string key, object asset) { assets.put(key, asset); } public <t> t getasset(string key, class<t> clazz) { return (t) assets.get(key); } public void freeasset(string key) { assets.remove(key); } }
that generic getter optional, casts yourself, it's more convenient. of course there error handling , missing, that's how very basic assetmanager might work.
Comments
Post a Comment