Back to project page OpenGL-Sample-Android.
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.
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); } } }