Jump to content
Posted 16 August 2012 - 02:36 PM
Posted 17 August 2012 - 06:28 AM
Between Scylla and Charybdis: First Look <-- The game I'm working on
Object-Oriented Programming Sucks <-- The kind of thing I say
Posted 17 August 2012 - 09:47 PM
If your resource loader is returning the images/audio from the hash map by reference, then your instance is using the SAME copy and taking up no additional memory (except the size of a pointer/reference.) However, for images, if you're rendering with hardware, then you are also necessarily holding a copy of the image in video memory.
Also, I go about my resource loading in a different way. I like to have a completely generic loading backend, when possible, that loads files from some source (generally the filesystem, but could be the network, or an archive) and puts them into memory as a blob. Then, I pass that blob off the particular subsystem to be decoded and whatnot. This way, you don't end up duplicating your file loading logic. Loading images, loading audio, loading models, etc. are all the same at the most basic level.