Creates a sub-z-buffer.
Creates a sub-z-buffer, ie. a z-buffer sharing drawing memory with a
pre-existing z-buffer, but possibly with a different size. The same rules
as for sub-bitmaps apply: the sub-z-buffer width and height can extend
beyond the right and bottom edges of the parent (they will be clipped),
but the origin point must lie within the parent region.
When drawing z-buffered to a bitmap, the top left corner of the bitmap is
always mapped to the top left corner of the current z-buffer. So this
function is primarily useful if you want to draw to a sub-bitmap and use
the corresponding sub-area of the z-buffer. In other cases, eg. if you
just want to draw to a sub-bitmap of screen (and not to other parts of
screen), then you would usually want to create a normal z-buffer (not
sub-z-buffer) the size of the visible screen. You don't need to first
create a z-buffer the size of the virtual screen and then a sub-z-buffer
Returns the pointer to the sub ZBUFFER or NULL if there was an error.
Remember to destroy the ZBUFFER once you are done with it, to avoid having
The following projects include source code containing this keyword: