add and use utility to set Int color as uniform

This commit is contained in:
Hannes Janetzek
2013-03-16 01:35:41 +01:00
parent f262efee7f
commit 3e6ac7d5d4
6 changed files with 67 additions and 55 deletions

View File

@@ -26,6 +26,10 @@ import android.util.Log;
* Utility functions
*/
public class GlUtils {
public static native void setColor(int location, int color, float alpha);
public static native void setColorBlend(int location, int color1, int color2, float mix);
private static String TAG = "GlUtils";
public static void setTextureParameter(int min_filter, int mag_filter, int wrap_s, int wrap_t) {
@@ -202,6 +206,7 @@ public class GlUtils {
return oom;
}
public static void setBlendColors(int handle, float[] c1, float[] c2, float mix) {
if (mix <= 0f)
GLES20.glUniform4fv(handle, 1, c1, 0);