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 / Do I need to delete an image before replacing it with a new one?

Author
Message
SamJ
12
Years of Service
User Offline
Joined: 27th Dec 2011
Location:
Posted: 14th Mar 2012 07:00
If I load an image using the following code:

Tier 1: myImage = LoadImage("ImageA.png")
Tier 2: myImage = agk::LoadImage("ImageA.png")

Will AppGameKit automatically handle memory management so if I then load a second image into the same ID, it will erase the original from memory?

Tier 1: myImage = LoadImage("ImageB.png")
Tier 2: myImage = agk::LoadImage("ImageB.png")

Or must I first manually delete the original image before loading a new one into the same ID?
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 14th Mar 2012 08:00
Hi Samj, you can have multiple images loaded into memory at the same time (which is perfectly fine so long as you don't load too many) however they cannot share the same reference number. But, if you only want one image loaded at a time then you would have to manually delete them.

Login to post a reply

Server time is: 2024-05-07 11:58:28
Your offset time is: 2024-05-07 11:58:28