1create_sub_zbuffer(3) Allegro manual create_sub_zbuffer(3)
2
3
4
6 create_sub_zbuffer - Creates a sub-z-buffer. Allegro game programming
7 library.
8
10 #include <allegro.h>
11
12
13 ZBUFFER *create_sub_zbuffer(ZBUFFER *parent, int x, int y, int width,
14 int height);
15
17 Creates a sub-z-buffer, ie. a z-buffer sharing drawing memory with a
18 pre-existing z-buffer, but possibly with a different size. The same
19 rules as for sub-bitmaps apply: the sub-z-buffer width and height can
20 extend beyond the right and bottom edges of the parent (they will be
21 clipped), but the origin point must lie within the parent region.
22
23 When drawing z-buffered to a bitmap, the top left corner of the bitmap
24 is always mapped to the top left corner of the current z-buffer. So
25 this function is primarily useful if you want to draw to a sub-bitmap
26 and use the corresponding sub-area of the z-buffer. In other cases, eg.
27 if you just want to draw to a sub-bitmap of screen (and not to other
28 parts of screen), then you would usually want to create a normal z-buf‐
29 fer (not sub-z-buffer) the size of the visible screen. You don't need
30 to first create a z-buffer the size of the virtual screen and then a
31 sub-z-buffer of that.
32
34 Returns the pointer to the sub ZBUFFER or NULL if there was an error.
35 Remember to destroy the ZBUFFER once you are done with it, to avoid
36 having memory leaks.
37
38
40 create_zbuffer(3), create_sub_bitmap(3), destroy_zbuffer(3)
41
42
43
44Allegro version 4.4.2 create_sub_zbuffer(3)