Android Open Source - touchgloid Shader






From Project

Back to project page touchgloid.

License

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.

Java Source Code

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();

}




Java Source Code List

rucamzu.opengl.Buffer.java
rucamzu.opengl.FragmentShader.java
rucamzu.opengl.IndexBuffer.java
rucamzu.opengl.Object.java
rucamzu.opengl.Program.java
rucamzu.opengl.Shader.java
rucamzu.opengl.Transform.java
rucamzu.opengl.Vector.java
rucamzu.opengl.VertexBuffer.java
rucamzu.opengl.VertexShader.java
rucamzu.touchgloid.TouchgloidActivity.java
rucamzu.touchgloid.TouchgloidRenderer.java
rucamzu.touchgloid.TouchgloidView.java