Android Open Source - OpenGL-Sample-Android Gl Helper






From Project

Back to project page OpenGL-Sample-Android.

License

The source code is released under:

GNU General Public License

If you think the Android project OpenGL-Sample-Android 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 com.soft.wz.sample.utils;
/*w  ww .  j  a  v a 2s.  c  o m*/
import android.opengl.GLES20;

/**
 * Created by wz on 01/10/2015.
 */
public class GlHelper {

    public static int loadShader(int type, String shaderCode) {
        int shader = GLES20.glCreateShader(type);

        GLES20.glShaderSource(shader, shaderCode);
        GLES20.glCompileShader(shader);

        return shader;
    }

    public static void checkGlError(String glOperation) {
        int error;
        while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
            throw new RuntimeException(glOperation + ": glError " + error);
        }
    }

}




Java Source Code List

com.soft.wz.sample.BasicRenderer.java
com.soft.wz.sample.MainActivity.java
com.soft.wz.sample.RenderView.java
com.soft.wz.sample.primitives.Circle.java
com.soft.wz.sample.primitives.Colors.java
com.soft.wz.sample.primitives.Cube.java
com.soft.wz.sample.primitives.Shape.java
com.soft.wz.sample.utils.CircularIterator.java
com.soft.wz.sample.utils.GlHelper.java