|
|
|
|
SPR_mgrAddOpaqueBitmap
Adds an opaque or non-transparent bitmap to the Sprite Manager
Declaration
SPR_bitmap * MGLAPI SPR_mgrAddOpaqueBitmap(
SPR_bitmapManager *mgr,
bitmap_t *bmp)
Prototype In
gm/sprite.h
Parameters
mgr |
Bitmap manager to add sprite to |
bmp |
MGL bitmap to add to the Sprite Manager |
Return Value
Pointer to the loaded sprite object
Description
This function adds a new opaque or non-transparent bitmap to the Sprite Manager. When you add the bitmap, the Sprite Manager takes over ownership of the memory allocated to the bitmap and you must not call MGL_unloadBitmap on the bitmap to free the memory. Once the bitmap has been added, you can then draw the bitmap by calling SPR_draw and pass in the pointer to the bitmap returned by this function.
Note: The bitmap added to the Sprite Manager must be in the same format at the device context that the bitmaps will be copied to. Hence you should add code to your program to do any necessary conversions to the destination pixel format for the bitmaps (see the Fox & Bear sample program which contains code to do this).
Note: The Sprite Manager also maintains ownership of the SPR_bitmap object that is returned by this function, and this object will be destroyed automatically when you empty or exit the Sprite Manager. You can call SPR_destroyBitmap if you wish to destroy the bitmap.
See Also
SPR_mgrAddTransparentBitmap, SPR_draw, SPR_mgrEmpty, SPR_destroyBitmap
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com