#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 The maximum value is 1024. For mipmaps, or when GX_REPEAT/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 The maximum value is 1024. For mipmaps, or when GX_REPEAT/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; otherwise, 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 GXInitTexObjCI.
If the mipmap flag is GX_TRUE, then the texture is a mipmap and the texture will be trilerped. If the mipmap flag is GX_FALSE, the texture is not a mipmap and the texture will be bilerped. To override the filter modes and other mipmap controls, call GXInitTexObjLOD 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
03/01/2006 Initial version.