Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Does unloading an image automatically unload the subimages?

Author
Message
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 6th Sep 2017 19:13
I think I'm right in thinking(!) that deleting an image automatically deletes (and therefore frees up the memory) of the subimages loaded from the parent image but... having made assumptions that have bitten me(!) I'd like to know for sure...

My pseudo code looks like this...



I then reference the subimages to create sprites(tiles in my game) or to add animation frames to sprites (again tiles)
Later when I am unloading the graphics (cleanup) I delete the MainAtlasImageID image.
My query is... does erasing this image also erase (and free up the memory) from the SubImageIDs images or do I need to explicitly erase (delete) the subimages too?
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 6th Sep 2017 20:37
Yes, AppGameKit will clean up all sub images that have been loaded from the main image if you haven't deleted them yourself. But it is a good habit to get into to delete everything you create.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 6th Sep 2017 20:43
OK, cool, thanks. I'll explicitly delete the subimages. Thanks Paul.
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)

Login to post a reply

Server time is: 2024-11-24 07:18:16
Your offset time is: 2024-11-24 07:18:16