IonicWind Software

IWBasic => Games and Graphics => Topic started by: pistol350 on June 08, 2008, 04:14:26 AM

Title: Sprites Loading and freeing question
Post by: pistol350 on June 08, 2008, 04:14:26 AM
hi all!

I am working on a project in which i use many sprites.
Let's say for instance that i have to load 20 sprites but for some simple reasons the 20th sprite does not load,
in which case the Loadsprite() command returns an error.
I think that before closing my screen and ending my application, I HAVE TO free all resources loaded previously;
including the first 19 sprites as not doing so WILL / MAY cause (memory leaking) problems.
Am i right ?
Title: Re: Sprites Loading and freeing question
Post by: LarryMc on June 08, 2008, 06:06:04 AM
From the Help pages for FREESPRITE:

QuoteAll sprites must be freed before the screen is called or memory loss will occur.

Larry
Title: Re: Sprites Loading and freeing question
Post by: pistol350 on June 08, 2008, 09:23:09 AM
Thank you Larry!

I think that you understood my point.
I've seen this "omission" so many times that i really wondered what was the proper way of doing things.