-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGLPProgram+SetUniform.m
228 lines (180 loc) · 6.36 KB
/
GLPProgram+SetUniform.m
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#import "GLPProgram+SetUniform.h"
#import "GLPUniformBase.h"
@implementation GLPProgram (SetUniform)
- (void)setUniform:(GLint)location floatValue:(GLfloat)x
{
glpUniform1f(program, location, x);
}
- (void)setUniform:(GLint)location floatValue:(GLfloat)x :(GLfloat)y
{
glpUniform2f(program, location, x, y);
}
- (void)setUniform:(GLint)location floatValue:(GLfloat)x :(GLfloat)y :(GLfloat)z
{
glpUniform3f(program, location, x, y, z);
}
- (void)setUniform:(GLint)location floatValue:(GLfloat)x :(GLfloat)y :(GLfloat)z :(GLfloat)w
{
glpUniform4f(program, location, x, y, z, w);
}
- (void)setUniform:(GLint)location float1Values:(const GLfloat *)values count:(GLsizei)count
{
glpUniform1fv(program, location, count, values);
}
- (void)setUniform:(GLint)location float2Values:(const GLfloat *)values count:(GLsizei)count
{
glpUniform2fv(program, location, count, values);
}
- (void)setUniform:(GLint)location float3Values:(const GLfloat *)values count:(GLsizei)count
{
glpUniform3fv(program, location, count, values);
}
- (void)setUniform:(GLint)location float4Values:(const GLfloat *)values count:(GLsizei)count
{
glpUniform4fv(program, location, count, values);
}
- (void)setUniform:(GLint)location intValue:(GLint)x
{
glpUniform1i(program, location, x);
}
- (void)setUniform:(GLint)location intValue:(GLint)x :(GLint)y
{
glpUniform2i(program, location, x, y);
}
- (void)setUniform:(GLint)location intValue:(GLint)x :(GLint)y :(GLint)z
{
glpUniform3i(program, location, x, y, z);
}
- (void)setUniform:(GLint)location intValue:(GLint)x :(GLint)y :(GLint)z :(GLint)w
{
glpUniform4i(program, location, x, y, z, w);
}
- (void)setUniform:(GLint)location int1Values:(const GLint *)values count:(GLsizei)count
{
glpUniform1iv(program, location, count, values);
}
- (void)setUniform:(GLint)location int2Values:(const GLint *)values count:(GLsizei)count
{
glpUniform2iv(program, location, count, values);
}
- (void)setUniform:(GLint)location int3Values:(const GLint *)values count:(GLsizei)count
{
glpUniform3iv(program, location, count, values);
}
- (void)setUniform:(GLint)location int4Values:(const GLint *)values count:(GLsizei)count
{
glpUniform4iv(program, location, count, values);
}
- (void)setUniform:(GLint)location matrix2Value:(const GLfloat *)value
{
glpUniformMatrix2fv(program, location, 1, GL_FALSE, value);
}
- (void)setUniform:(GLint)location matrix3Value:(const GLfloat *)value
{
glpUniformMatrix3fv(program, location, 1, GL_FALSE, value);
}
- (void)setUniform:(GLint)location matrix4Value:(const GLfloat *)value
{
glpUniformMatrix4fv(program, location, 1, GL_FALSE, value);
}
- (void)setUniform:(GLint)location matrix2Values:(const GLfloat *)value count:(GLsizei)count
{
glpUniformMatrix2fv(program, location, count, GL_FALSE, value);
}
- (void)setUniform:(GLint)location matrix3Values:(const GLfloat *)value count:(GLsizei)count
{
glpUniformMatrix3fv(program, location, count, GL_FALSE, value);
}
- (void)setUniform:(GLint)location matrix4Values:(const GLfloat *)value count:(GLsizei)count
{
glpUniformMatrix4fv(program, location, count, GL_FALSE, value);
}
- (void)setUniformNamed:(NSString*)name floatValue:(GLfloat)x
{
glpUniformNamed1f(program, name.UTF8String, x);
}
- (void)setUniformNamed:(NSString*)name floatValue:(GLfloat)x :(GLfloat)y
{
glpUniformNamed2f(program, name.UTF8String, x, y);
}
- (void)setUniformNamed:(NSString*)name floatValue:(GLfloat)x :(GLfloat)y :(GLfloat)z
{
glpUniformNamed3f(program, name.UTF8String, x, y, z);
}
- (void)setUniformNamed:(NSString*)name floatValue:(GLfloat)x :(GLfloat)y :(GLfloat)z :(GLfloat)w
{
glpUniformNamed4f(program, name.UTF8String, x, y, z, w);
}
- (void)setUniformNamed:(NSString*)name float1Values:(const GLfloat *)values count:(GLsizei)count
{
glpUniformNamed1fv(program, name.UTF8String, count, values);
}
- (void)setUniformNamed:(NSString*)name float2Values:(const GLfloat *)values count:(GLsizei)count
{
glpUniformNamed2fv(program, name.UTF8String, count, values);
}
- (void)setUniformNamed:(NSString*)name float3Values:(const GLfloat *)values count:(GLsizei)count
{
glpUniformNamed3fv(program, name.UTF8String, count, values);
}
- (void)setUniformNamed:(NSString*)name float4Values:(const GLfloat *)values count:(GLsizei)count
{
glpUniformNamed4fv(program, name.UTF8String, count, values);
}
- (void)setUniformNamed:(NSString*)name intValue:(GLint)x
{
glpUniformNamed1i(program, name.UTF8String, x);
}
- (void)setUniformNamed:(NSString*)name intValue:(GLint)x :(GLint)y
{
glpUniformNamed2i(program, name.UTF8String, x, y);
}
- (void)setUniformNamed:(NSString*)name intValue:(GLint)x :(GLint)y :(GLint)z
{
glpUniformNamed3i(program, name.UTF8String, x, y, z);
}
- (void)setUniformNamed:(NSString*)name intValue:(GLint)x :(GLint)y :(GLint)z :(GLint)w
{
glpUniformNamed4i(program, name.UTF8String, x, y, z, w);
}
- (void)setUniformNamed:(NSString*)name int1Values:(const GLint *)values count:(GLsizei)count
{
glpUniformNamed1iv(program, name.UTF8String, count, values);
}
- (void)setUniformNamed:(NSString*)name int2Values:(const GLint *)values count:(GLsizei)count
{
glpUniformNamed2iv(program, name.UTF8String, count, values);
}
- (void)setUniformNamed:(NSString*)name int3Values:(const GLint *)values count:(GLsizei)count
{
glpUniformNamed3iv(program, name.UTF8String, count, values);
}
- (void)setUniformNamed:(NSString*)name int4Values:(const GLint *)values count:(GLsizei)count
{
glpUniformNamed4iv(program, name.UTF8String, count, values);
}
- (void)setUniformNamed:(NSString*)name matrix2Value:(const GLfloat *)value
{
glpUniformNamedMatrix2fv(program, name.UTF8String, 1, GL_FALSE, value);
}
- (void)setUniformNamed:(NSString*)name matrix3Value:(const GLfloat *)value
{
glpUniformNamedMatrix3fv(program, name.UTF8String, 1, GL_FALSE, value);
}
- (void)setUniformNamed:(NSString*)name matrix4Value:(const GLfloat *)value
{
glpUniformNamedMatrix4fv(program, name.UTF8String, 1, GL_FALSE, value);
}
- (void)setUniformNamed:(NSString*)name matrix2Values:(const GLfloat *)value count:(GLsizei)count
{
glpUniformNamedMatrix2fv(program, name.UTF8String, count, GL_FALSE, value);
}
- (void)setUniformNamed:(NSString*)name matrix3Values:(const GLfloat *)value count:(GLsizei)count
{
glpUniformNamedMatrix3fv(program, name.UTF8String, count, GL_FALSE, value);
}
- (void)setUniformNamed:(NSString*)name matrix4Values:(const GLfloat *)value count:(GLsizei)count
{
glpUniformNamedMatrix4fv(program, name.UTF8String, count, GL_FALSE, value);
}
@end