GXPeekZ

C Specification

#include <revolution/gx.h>
void GXPeekZ( u16 x, u16 y, u32* z );

Arguments

x The x coordinate, in pixels(0 - 639).
y They coordinate, in lines (0 - 527). 
z Pointer to a returned Z value. Z value will be read from position (x,y) in the EFB.
Returned Z value will be in the range of 0x00000000 to 0x00FFFFFF.

Return Values

None.

Description

This function allows the CPU to read a z value directly from the Embedded Frame Buffer (EFB) at position x,y. The z value is the raw integer value from the Z buffer. The value range is 24-bit when reading from a non-antialiased frame buffer.

When reading from an antialiased frame buffer, subsample 0 is read and returned. The value is in compressed 16-bit form. To convert the compressed value to a plain 24-bit integer, use GXDecompressZ16.

See Also

GXPokeZ
GXDecompressZ16

Revision History

03/01/2006 Initial version.