From 7d4e4c0b34a613dd3c0220475ae4e448197522c1 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 12 Mar 2011 23:17:12 +0100 Subject: initial commit. now I can start playing with stuff! --- include/rvl/GXTexture.h | 127 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100755 include/rvl/GXTexture.h (limited to 'include/rvl/GXTexture.h') diff --git a/include/rvl/GXTexture.h b/include/rvl/GXTexture.h new file mode 100755 index 0000000..b51f6d5 --- /dev/null +++ b/include/rvl/GXTexture.h @@ -0,0 +1,127 @@ +#ifndef __GXTEXTURE_H__ +#define __GXTEXTURE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------*/ + +typedef GXTexRegion* (*GXTexRegionCallback) (const GXTexObj* t_obj, GXTexMapID id); +typedef GXTlutRegion* (*GXTlutRegionCallback)(u32 idx); + +/*---------------------------------------------------------------------------*/ +void GXInitTexObj( + GXTexObj* obj, + void* image_ptr, + u16 width, + u16 height, + GXTexFmt format, + GXTexWrapMode wrap_s, + GXTexWrapMode wrap_t, + GXBool mipmap); + +void GXInitTexObjCI( + GXTexObj* obj, + void* image_ptr, + u16 width, + u16 height, + GXCITexFmt format, + GXTexWrapMode wrap_s, + GXTexWrapMode wrap_t, + GXBool mipmap, + u32 tlut_name); + +void GXInitTexObjLOD( + GXTexObj* obj, + GXTexFilter min_filt, + GXTexFilter mag_filt, + f32 min_lod, + f32 max_lod, + f32 lod_bias, + GXBool bias_clamp, + GXBool do_edge_lod, + GXAnisotropy max_aniso ); + +void GXInitTexObjData ( GXTexObj* obj, void* image_ptr ); +void GXInitTexObjWrapMode ( GXTexObj* obj, GXTexWrapMode s, GXTexWrapMode t ); +void GXInitTexObjTlut ( GXTexObj* obj, u32 tlut_name ); +void GXInitTexObjFilter ( GXTexObj* obj, GXTexFilter min_filt, GXTexFilter mag_filt ); +void GXInitTexObjMaxLOD ( GXTexObj* obj, f32 max_lod ); +void GXInitTexObjMinLOD ( GXTexObj* obj, f32 min_lod ); +void GXInitTexObjLODBias ( GXTexObj* obj, f32 lod_bias ); +void GXInitTexObjBiasClamp( GXTexObj* obj, GXBool bias_clamp ); +void GXInitTexObjEdgeLOD ( GXTexObj* obj, GXBool do_edge_lod ); +void GXInitTexObjMaxAniso ( GXTexObj* obj, GXAnisotropy max_aniso ); + + +void GXInitTexObjUserData ( GXTexObj* obj, void* user_data ); +void* GXGetTexObjUserData ( const GXTexObj* obj ); + +void GXLoadTexObj ( const GXTexObj* obj, GXTexMapID id ); + +u32 GXGetTexBufferSize( + u16 width, + u16 height, + u32 format, + GXBool mipmap, + u8 max_lod ); + +void GXInitTlutObj( + GXTlutObj* tlut_obj, + void* lut, + GXTlutFmt fmt, + u16 n_entries ); + +void GXLoadTlut ( const GXTlutObj* tlut_obj, u32 tlut_name ); + +void GXInitTexCacheRegion( + GXTexRegion* region, + GXBool is_32b_mipmap, + u32 tmem_even, + GXTexCacheSize size_even, + u32 tmem_odd, + GXTexCacheSize size_odd ); + +void GXInitTexPreLoadRegion( + GXTexRegion* region, + u32 tmem_even, + u32 size_even, + u32 tmem_odd, + u32 size_odd ); + +void GXInitTlutRegion( + GXTlutRegion* region, + u32 tmem_addr, + GXTlutSize tlut_size ); + +void GXInvalidateTexRegion ( const GXTexRegion* region ); +void GXInvalidateTexAll ( void ); +void GXPreLoadEntireTexture ( const GXTexObj* tex_obj, const GXTexRegion* region ); + +GXTexRegionCallback GXSetTexRegionCallback ( GXTexRegionCallback f ); +GXTlutRegionCallback GXSetTlutRegionCallback( GXTlutRegionCallback f ); + +void GXLoadTexObjPreLoaded( + const GXTexObj* obj, + const GXTexRegion* region, + GXTexMapID id ); + +void GXSetTexCoordScaleManually(GXTexCoordID coord, + GXBool enable, + u16 ss, u16 ts); + +void GXSetTexCoordCylWrap(GXTexCoordID coord, + GXBool s_enable, + GXBool t_enable); + +void GXSetTexCoordBias(GXTexCoordID coord, + GXBool s_enable, + GXBool t_enable); + +/*---------------------------------------------------------------------------*/ +#ifdef __cplusplus +} +#endif + +#endif // __GXTEXTURE_H__ -- cgit v1.2.3