#include <revolution/gx.h>
void GXSetTexCopyDst(
u16 wd,
u16 ht,
GXTexFmt fmt,
GXBool mipmap );
wd |
the distance (in texels) between successive lines within the texture buffer It must be a multiple of the texture tile width, which depends on the texture format, fmt. |
||||||||||||||||||||||||||||||||||||||||||||||||
ht |
the height of the texture buffer | ||||||||||||||||||||||||||||||||||||||||||||||||
fmt |
the generated texture format Accepted values are:
|
||||||||||||||||||||||||||||||||||||||||||||||||
mipmap |
For GX_TRUE, a box filter is applied to the EFB before the texture is generated. |
None.
This function sets the width, wd, and height, ht, of the destination texture buffer in texels. The application may render an image into the embedded frame buffer (EFB, source) and then copy it into a texture buffer in main memory. wd specifies the number of texels between adjacent lines in the texture buffer and can be different than the width of the source image. This function also sets the texture format, fmt, generated during the copy operation for texel generation. An optional box filter can be enabled using the mipmap flag. This flag will scale the source image by 1/2 in both width and height.
Normally, the width of the EFB and the destination wd are the same. When rendering smaller images that get copied and composited into a larger texture buffer, however, the EFB width and texture buffer wd are not necessarily the same.
The Z buffer can be copied to a Z texture format by setting fmt to GX_TF_Z24X8. Doing so is only valid when the EFB format is GX_PF_RGB8_Z24 or GX_PF_RGBA6_Z24.
The alpha channel can be copied from an EFB with the format GX_PF_RGBA6_Z24 by setting fmt to GX_TF_A8.
The GXGetTexBufferSize function can be used to calculate the texture buffer size based on the texture parameters. The GXCopyTex function actually performs the copy operation.
See GXTexFmt for more information on the texture copy format.
1: Texture copies into intensity formats (GX_TF_I8, GX_TF_I4, GX_TF_IA8 and GX_TF_IA4) use the resulting Y value from RGB-YUV conversion as the intensity value. This means that the output range is linearly compressed to 16 to 235. If exact values from the EFB are needed, formats like R8 and RA8 can be used.
2: Due to hardware design issues, texture copies into 16-bit Z formats put data in reverse byte order. Results cannot be directly used for Z textures.
03/01/2006 Initial version.