bmap_to_format(BMAP* bmap,var format)
Converts a bmap to a given color format.
Parameters:
bmap - bitmap to be converted.
format - the target format - 565, 888, 1555, 4444,
or
8888 (see
bmap_lock).
In A7 also
floating point textures are supported, in the following 4 formats: 12 =
16 bit floating point red, 14 = 32 bit floating point red, 12222 =
16 bit floating point ABGR, 14444 = 32 bit floating point ABGR.
Returns:
0 if the conversion failed, bmap otherwise
Speed:
Slow
Edition:
C
P
Remarks:
- When a target format is not available on the 3D hardware (like 888),
the function converts the bmap to the next-best format (8888 in
that case).
Use bmap_lock to retrieve the final format.
- This function can also be used to convert a render target or compressed
image bmap to a standard format that can
be
accessed
through pixel functions.
- A7
Floating point textures can be used as render targets for special purposes
in shaders. For instance, the 14 format is normally used to render
the scene depth into a bitmap in order to create soft-edged shadows. Please
note that only newer 3D cards support floating point textures for render
targets
See also:
bmap_lock, view.bmap