summaryrefslogtreecommitdiff
path: root/include/rvl/GX/GXTexture.h
blob: a8ae5f59aec2d6340ef05d7a1874e489baddb22f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef RVL_SDK_GX_TEXTURE_H
#define RVL_SDK_GX_TEXTURE_H
#include "common.h"
#include "rvl/GX/GXInternal.h"
#include "rvl/GX/GXTypes.h"

#ifdef __cplusplus
extern "C" {
#endif

GX_DECL_PUBLIC_STRUCT(GXTexObj, 32);
GX_DECL_PUBLIC_STRUCT(GXTlutObj, 12);

GX_DECL_PUBLIC_STRUCT(GXTexRegion, 16);
GX_DECL_PUBLIC_STRUCT(GXTlutRegion, 16);

typedef GXTexRegion *(*GXTexRegionCallback)(const GXTexObj *pObj, GXTexMapID map);

typedef GXTlutRegion *(*GXTlutRegionCallback)(u32 id);

void __GXSetSUTexRegs(void);

void GXInitTexObj(
    GXTexObj *pTexObj, void *pImage, u16 width, u16 height, GXTexFmt format, GXTexWrapMode wrapS, GXTexWrapMode wrapT,
    u8 mipmap
);
void GXInitTexObjLOD(
    GXTexObj *pTexObj, GXTexFilter minFilter, GXTexFilter magFilter, f32 minLOD, f32 maxLOD, f32 LODBias,
    u8 biasClampEnable, u8 edgeLODEnable, GXAnisotropy anisotropy
);
void GXInitTexObjTlut(GXTexObj *, u32);
void GXInitTexObjCI(GXTexObj *, void *, u16, u16, GXCITexFmt, GXTexWrapMode, GXTexWrapMode, u8, u32);

void GXInitTlutObj(GXTlutObj *, void *, GXTlutFmt, u16);
void GXLoadTlut(GXTlutObj *, u32);
void GXLoadTexObj(const GXTexObj *, GXTexMapID);

void GXGetTexObjAll(
    const GXTexObj *pTexObj, void **pImage, u16 *width, u16 *height, GXTexFmt *format, GXTexWrapMode *wrapS,
    GXTexWrapMode *wrapT, u8 *mipmap
);
void GXGetTexObjLODAll(
    const GXTexObj *pTexObj, GXTexFilter *minFilter, GXTexFilter *magFilter, f32 *minLOD, f32 *maxLOD, f32 *LODBias,
    u8 *biasClampEnable, u8 *edgeLODEnable, GXAnisotropy *anisotropy
);

void GXInitTexObjFilter(GXTexObj *, GXTexFilter minFilter, GXTexFilter magFilter);
void GXInitTexObjWrapMode(GXTexObj *, GXTexWrapMode wrapS, GXTexWrapMode wrapT);

void GXSetTexCoordScaleManually(GXTexCoordID, GXBool, u16, u16);
void GXSetTexCoordBias(GXTexCoordID, GXBool, GXBool);

u16 GXGetTexObjWidth(const GXTexObj *obj);
u16 GXGetTexObjHeight(const GXTexObj *obj);
GXTexFmt GXGetTexObjFmt(const GXTexObj *obj);
GXBool GXGetTexObjMipMap(const GXTexObj *obj);
GXTexWrapMode GXGetTexObjWrapS(const GXTexObj *obj);
u32 GXGetTexObjTlut(const GXTexObj *);
GXTexWrapMode GXGetTexObjWrapT(const GXTexObj *);
GXTexFilter GXGetTexObjMinFilt(const GXTexObj *);
GXTexFilter GXGetTexObjMagFilt(const GXTexObj *);
void *GXGetTexObjData(const GXTexObj *);
u32 GXGetTexBufferSize(u16 width, u16 height, u32 format, GXBool arg3, u8 arg4);

void GXInvalidateTexAll();

void GXInitTexCacheRegion(
    GXTexRegion *pRegion, GXBool r4, u32 addrTMemEven, u32 sizeTMemEven, u32 addrTMemOdd, u32 sizeTMemOdd
);

void GXInitTlutRegion(GXTlutRegion *pRegion, u32 addrTMem, u32 sizeTMem);
GXTexRegionCallback GXSetTexRegionCallback(GXTexRegionCallback callback);
GXTlutRegionCallback GXSetTlutRegionCallback(GXTlutRegionCallback callback);

#ifdef __cplusplus
}
#endif
#endif