@@ -97,7 +97,7 @@ public void onOutputSizeChanged(final int width, final int height) {
97
97
}
98
98
99
99
public void onDraw (final int textureId , final FloatBuffer cubeBuffer ,
100
- final FloatBuffer textureBuffer ) {
100
+ final FloatBuffer textureBuffer ) {
101
101
GLES20 .glUseProgram (mGLProgId );
102
102
runPendingOnDrawTasks ();
103
103
if (!mIsInitialized ) {
@@ -158,7 +158,8 @@ public int getUniformTexture() {
158
158
159
159
protected void setInteger (final int location , final int intValue ) {
160
160
runOnDraw (new Runnable () {
161
- @ Override public void run () {
161
+ @ Override
162
+ public void run () {
162
163
GLES20 .glUniform1i (location , intValue );
163
164
}
164
165
});
@@ -175,32 +176,36 @@ public void run() {
175
176
176
177
protected void setFloatVec2 (final int location , final float [] arrayValue ) {
177
178
runOnDraw (new Runnable () {
178
- @ Override public void run () {
179
- GLES20 .glUniform2fv (location , 1 , arrayValue );
179
+ @ Override
180
+ public void run () {
181
+ GLES20 .glUniform2fv (location , 1 , FloatBuffer .wrap (arrayValue ));
180
182
}
181
183
});
182
184
}
183
185
184
186
protected void setFloatVec3 (final int location , final float [] arrayValue ) {
185
187
runOnDraw (new Runnable () {
186
- @ Override public void run () {
187
- GLES20 .glUniform3fv (location , 1 , arrayValue );
188
+ @ Override
189
+ public void run () {
190
+ GLES20 .glUniform3fv (location , 1 , FloatBuffer .wrap (arrayValue ));
188
191
}
189
192
});
190
193
}
191
194
192
195
protected void setFloatVec4 (final int location , final float [] arrayValue ) {
193
196
runOnDraw (new Runnable () {
194
- @ Override public void run () {
195
- GLES20 .glUniform4fv (location , 1 , arrayValue );
197
+ @ Override
198
+ public void run () {
199
+ GLES20 .glUniform4fv (location , 1 , FloatBuffer .wrap (arrayValue ));
196
200
}
197
201
});
198
202
}
199
203
200
204
protected void setFloatArray (final int location , final float [] arrayValue ) {
201
205
runOnDraw (new Runnable () {
202
- @ Override public void run () {
203
- GLES20 .glUniform1fv (location , sizeof (arrayValue ), arrayValue );
206
+ @ Override
207
+ public void run () {
208
+ GLES20 .glUniform1fv (location , arrayValue .length , FloatBuffer .wrap (arrayValue ));
204
209
}
205
210
});
206
211
}
0 commit comments