You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
764 B
Java
33 lines
764 B
Java
2 years ago
|
package com.yinuo.library.vlc;
|
||
|
|
||
|
import android.content.Context;
|
||
|
|
||
|
import static android.opengl.GLES20.glUseProgram;
|
||
|
|
||
|
/**
|
||
|
* Created by liwentian on 17/6/22.
|
||
|
*/
|
||
|
|
||
|
public class ShaderProgram {
|
||
|
|
||
|
public final String TAG = getClass().getSimpleName();
|
||
|
|
||
|
protected final int program;
|
||
|
|
||
|
protected final Context context;
|
||
|
|
||
|
protected int width, height;
|
||
|
|
||
|
protected ShaderProgram(Context context, int vertexId, int fragId, int width, int height) {
|
||
|
this.context = context;
|
||
|
this.width = width;
|
||
|
this.height = height;
|
||
|
program = ShaderHelper.buildProgram(ResourceUtils.readText(context, vertexId),
|
||
|
ResourceUtils.readText(context, fragId));
|
||
|
}
|
||
|
|
||
|
public void useProgram() {
|
||
|
glUseProgram(program);
|
||
|
}
|
||
|
}
|