Back to project page touchgloid.
The source code is released under:
MIT License
If you think the Android project touchgloid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package rucamzu.opengl; // w ww . j a va 2 s .c o m import static android.opengl.GLES20.GL_COMPILE_STATUS; import static android.opengl.GLES20.glCompileShader; import static android.opengl.GLES20.glDeleteShader; import static android.opengl.GLES20.glGetShaderiv; import static android.opengl.GLES20.glShaderSource; public abstract class Shader extends Object { protected Shader(int id) { super(id); } public Shader source(String source) { glShaderSource(id, source); return this; } public Shader compile() { glCompileShader(id); return this; } public int status() { int[] status = { 0 }; glGetShaderiv(id, GL_COMPILE_STATUS, status, 0); return status[0]; } @Override public void delete() { glDeleteShader(id); } protected abstract int getType(); }