sead
Loading...
Searching...
No Matches
aglTextureSampler.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
namespace
agl
{
4
5
inline
void
6
TextureSampler
::
applyTextureData
(
const
TextureData
&
texture_data
)
7
{
8
if
(!
mIsTextureSet
||
mTextureData
!=
texture_data
)
9
applyTextureData_
(
texture_data
);
10
11
else
12
{
13
void
*
image_ptr
=
texture_data
.
getImagePtr
();
14
void
*
mip_ptr
=
texture_data
.
getMipPtr
();
15
16
mTextureData
.
setImagePtr
(
image_ptr
);
17
mTextureData
.
setMipPtr
(
mip_ptr
);
18
19
mGX2Texture
.
surface
.
imagePtr
=
image_ptr
;
20
mGX2Texture
.
surface
.
mipPtr
=
mip_ptr
;
21
}
22
}
23
24
inline
void
25
TextureSampler
::
setTextureCompSel
(
26
TextureCompSel
r
,
27
TextureCompSel
g
,
28
TextureCompSel
b
,
29
TextureCompSel
a
30
)
31
{
32
mCompR
=
r
;
33
mCompG
=
g
;
34
mCompB
=
b
;
35
mCompA
=
a
;
36
37
mReplaceCompSel
=
true
;
38
mFlag
.
setBit
(0);
39
}
40
41
inline
void
42
TextureSampler
::
resetTextureCompSel
()
43
{
44
mReplaceCompSel
=
false
;
45
mFlag
.
setBit
(0);
46
}
47
48
inline
void
49
TextureSampler
::
setWrapX
(
TextureWrapType
wrap_x
)
50
{
51
mWrapX
=
wrap_x
;
52
mFlag
.
setBit
(1);
53
}
54
55
inline
void
56
TextureSampler
::
setWrapY
(
TextureWrapType
wrap_y
)
57
{
58
mWrapY
=
wrap_y
;
59
mFlag
.
setBit
(1);
60
}
61
62
inline
void
63
TextureSampler
::
setWrapZ
(
TextureWrapType
wrap_z
)
64
{
65
mWrapZ
=
wrap_z
;
66
mFlag
.
setBit
(1);
67
}
68
69
inline
void
70
TextureSampler
::
setWrap
(
71
TextureWrapType
wrap_x
,
72
TextureWrapType
wrap_y
,
73
TextureWrapType
wrap_z
74
)
75
{
76
mWrapX
=
wrap_x
;
77
mWrapY
=
wrap_y
;
78
mWrapZ
=
wrap_z
;
79
mFlag
.
setBit
(1);
80
}
81
82
inline
void
83
TextureSampler
::
setFilterMag
(
TextureFilterType
filter_mag
)
84
{
85
mFilterMag
=
filter_mag
;
86
mFlag
.
setBit
(2);
87
}
88
89
inline
void
90
TextureSampler
::
setFilterMin
(
TextureFilterType
filter_min
)
91
{
92
mFilterMin
=
filter_min
;
93
mFlag
.
setBit
(2);
94
}
95
96
inline
void
97
TextureSampler
::
setFilterMip
(
TextureMipFilterType
filter_mip
)
98
{
99
mFilterMip
=
filter_mip
;
100
mFlag
.
setBit
(2);
101
}
102
103
inline
void
104
TextureSampler
::
setFilter
(
105
TextureFilterType
filter_mag
,
106
TextureFilterType
filter_min
,
107
TextureMipFilterType
filter_mip
108
)
109
{
110
mFilterMag
=
filter_mag
;
111
mFilterMin
=
filter_min
;
112
mFilterMip
=
filter_mip
;
113
mFlag
.
setBit
(2);
114
}
115
116
inline
void
117
TextureSampler
::
setMaxAnisoRatio
(
TextureAnisoRatio
max_aniso
)
118
{
119
mMaxAniso
=
max_aniso
;
120
mFlag
.
setBit
(2);
121
}
122
123
inline
void
124
TextureSampler
::
setMipParam
(
f32
lod_min
,
f32
lod_max
,
f32
lod_bias
)
125
{
126
mLODMin
=
lod_min
;
127
mLODMax
=
lod_max
;
128
mLODBias
=
lod_bias
;
129
mFlag
.
setBit
(3);
130
}
131
132
inline
void
133
TextureSampler
::
setDepthCompareEnable
(
bool
enable
)
134
{
135
mDepthCompareEnable
=
enable
;
136
mFlag
.
setBit
(4);
137
}
138
139
inline
void
140
TextureSampler
::
setDepthCompareFunc
(
sead
::
Graphics
::
DepthFunc
func
)
141
{
142
mDepthCompareFunc
=
func
;
143
mFlag
.
setBit
(4);
144
}
145
146
inline
void
147
TextureSampler
::
setBorderColor
(
f32
r
,
f32
g
,
f32
b
,
f32
a
)
148
{
149
mBorderColor
.
setf
(
r
,
g
,
b
,
a
);
150
mFlag
.
setBit
(5);
151
}
152
153
inline
void
154
TextureSampler
::
setBorderColor
(
const
sead
::
Color4f
&
color
)
155
{
156
mBorderColor
=
color
;
157
mFlag
.
setBit
(5);
158
}
159
160
inline
const
GX2Texture
&
161
TextureSampler
::
getTexture
()
const
162
{
163
if
(!
mFlag
.
isZero
())
164
initRegs_
();
165
166
return
mGX2Texture
;
167
}
168
169
}
agl
Definition
aglDisplayList.cpp:5
packages
agl
include
common
aglTextureSampler.hpp
Generated by
1.14.0