#include <revolution/gx.h>
void GXInitTexObj(
GXTexObj* obj,
void* image_ptr,
u16 width,
u16 height,
GXTexFmt format,
GXTexWrapMode wrap_s,
GXTexWrapMode wrap_t,
GXBool mipmap );
obj |
Pointer to a texture object. | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
image_ptr |
Pointer to the image data for a texture. 32-byte aligned. | ||||||||||||||||||||||||
| width | Width of the texture or LOD 0 for mipmaps. Maximum value is 1024. For mipmaps, or when GX_REPEAT or GX_MIRROR is the wrap mode for wrap_s, width must be a power of two. |
||||||||||||||||||||||||
| height | Height of the texture or LOD 0 for mipmaps. Maximum value is 1024. For mipmaps, or when GX_REPEAT or GX_MIRROR is the wrap mode for wrap_t, height must be a power of two. |
||||||||||||||||||||||||
| format | The texel format. Accepted values are:
|
||||||||||||||||||||||||
| wrap_s | Describes how texture coordinates will be wrapped in the S direction. Accepted values are:
|
||||||||||||||||||||||||
| wrap_t | Describes how texture coordinates will be wrapped in the T direction. Accepted values are:
|
||||||||||||||||||||||||
| mipmap | When mipmap = GX_TRUE, the texture is a mipmap and will have trilinear filtering; if not GX_TRUE, it is not a mipmap and will use bilinear filtering. |
None.
This function is used to initialize or change a texture object for non-color index textures. Texture objects are used to describe all the parameters associated with a texture, including size, format, wrap modes, filter modes, etc. The application must provide memory for texture objects. Once initialized, a texture object can be associated with one of eight active IDs using the GXLoadTexObj function.
To initialize a texture object for color index format textures, use the GXInitTexObjCI function.
If the mipmap flag is GX_TRUE, then the texture is a mipmap and will be trilinear interpolated. If the mipmap flag is GX_FALSE, the texture is not a mipmap and will be bilinear interpolated. To override the filter modes, or use other mipmap controls, call the GXInitTexObjLOD function after GXInitTexObj. Mipmap textures should set the width and height to a power of two, but mipmaps do not need to be square.
GXInitTexObjCI, GXInitTexObjLOD, GXLoadTexObj, GXTexObj Initialization Flow
2006/03/01 Initial version.
CONFIDENTIAL