Destroy If you have any global bitmaps outside the functions you have to destroy them manually before the program exits. Local Bitmaps will be automatically destroyed when they fall out of scope and dynamically allocated Bitmaps will be destroyed when they're deleted. Note that if you call this function the bitmap can't be used anymore before it's loaded again. Any attempt to render a destroyed bitmap may lead to undefined behavior. Usually then the bitmap will appear in the screen as a white square. Examples Bitmap globalBitmap;
int main() { Setup::SetupProgram( ... ); Setup::SetupScreen( ... ); // Bitmaps can't be loaded before the libraries and the graphics mode are set up! // // See Setup for more information // globalBitmap.Load( ... ); /* * The other code of the main function here */ // A global bitmap must be destroyed before the program quits! // globalBitmap.Destroy(); return 0; } END_OF_MAIN() Other functions of the class Bitmap
Questions about Destroy? Click here. |