auxDIBImageLoad

I use this function to load my bitmaps. It works fine and everything since it can also load run length encoded bitmaps.

The problem or the fear I got is that I am not sure where the memory is allocated and for that manner if I need to delete it. Fearing the memory leak I call delete[] ptrAux->data and then delete ptrAux. What bugs me is that maybe it is not that good that I delete the memory if it would be deleted at some point by glaux. Second problem is that if I am not mistaken an application should not delete memory allocated in another DLL the other dll being glaux.

All that being said I have 2 choices:
Ignore the problem like a dummy and continue deleting the data using delete or free while I am not sure at all that this is ok or to write or find a bmp, tif or whatever file format loader.

Keep in mind that I am really satisfied with the functionnality of auxDIBImageLoad since it works fine with all the versions of bmps and that bmps are supported with my version of 3d max. So if someone knows how auxDIBImageLoad works in regards to it’s memory I am all ears to earing about it.

[This message has been edited by Fiante Endurcie (edited 11-30-2000).]

I have no idea for your memory deallocation problem w/ glaux.
But if you want, I can send you some code for a BMP loader or a Targa loader (Targa files support an alpha channel).

Yes, you need to free the pointer returned by the auxDIBImageload and the pointer to the pixel data otherwise you will get a ‘memory leak’. If a function is called the memory is usually allocated to the callers heap I think. But in any case, not freeing both definitely causes a memory leak!

I believe there is actually a memory leak problem with auxSolid/WireSphere() if anyone is interested.