Allocate a ScreenBuffer (and BitMap) for double or multiple buffering in Intuition screens. Use this function to obtain a ScreenBuffer for the screen's initial BitMap and for all other BitMaps you want to swap in. This function also allocates a DBufInfo from graphics.library The returned ScreenBuffer contains a pointer to that DBufInfo. See graphics.library/AllocDBufInfo() for more information on how to use this struct to obtain info when it is safe to render into an old buffer and when to switch.
INPUTS
screen
Screen to double-buffer
bitmap
You may pre-allocate a BitMap for CUSTOMBITMAP screens, and pass the pointer to get a ScreenBuffer referring to it. If you specify NULL, intuition will allocate the BitMap for
non
CUSTOMBITMAP screens this parameter must be NULL.
flags
A combination of these flags:
non
CUSTOMBITMAP screens to get a ScreenBuffer referring to the screen's actual BitMap (For CUSTOMBITMAP screens just pass the BitMap you used for OpenScreen() as the bitmap parameter) SB_COPY_BITMAP to copy the screen's BitMap intto the ScreenBuffer's BitMap. Use this to get intuition rendered
menu
bars or gadgets). May be omitted if the screen has no intuition rendered stuff, as well as for allocating a ScreenBuffer for the screen's initial BitMap.
RESULT
Pointer to the allocated ScreenBuffer or NULL if function failed.
EXAMPLE
SEE ALSO
FreeScreenBuffer(), ChangeScreenBuffer()
NOTES
You may render into the resulting BitMap. Use the sb_DBufInfo field to access graphics.library's ViewPort buffering features to e.g check if it is safe to reuse the previous BitMap. Otherwise you risk to write into the on-screen BitMap and damage menu or gadget rendering.