freeimage help:)
BlitzPlus Forums/BlitzPlus Programming/freeimage help:)
| ||
is there a way of checking if an image exists, before trying to free it? |
| ||
ok i got round it by creating an image before i free them, just in case. Does this cause a problem anyone know? |
| ||
You could just go:If [handle you gave the image]<>0 freeimage [handle you gave the image] EndIf |
| ||
or shorter: If handle blah Endif but that's personal style, a valid handle is always>0 .. e.g. 'true' On a different note, is there a way to check 'what' a handle is? If a given handle (a function arguement for example) is a correct handle, but a bank, gadget, timer etc. handle, rather than an image handle, and you try to free that with FreeImage.. can't be that good eh .. /me wants: IsImage(handle), IsBank(handle), IsWindow(handle), IsTimer(handle) etc. etc. Can that be arranged? |
| ||
thx peeps, hand to use true instead of <>0 but works just fine |
| ||
nicoust: have you ever played Dungeon Master, I ask this after seeing your self-classification. |