compile opengl Vertex Shader - Android android.opengl

Android examples for android.opengl:OpenGL Shader

Description

compile opengl Vertex Shader

Demo Code


//package com.java2s;

import android.opengl.GLES20;

public class Main {
    public static int compileVertexShader(String shaderCode) {
        return compileShader(GLES20.GL_VERTEX_SHADER, shaderCode);
    }/*w ww.jav  a 2  s . c o  m*/

    private static int compileShader(int type, String shaderCode) {
        final int shader = GLES20.glCreateShader(type);
        GLES20.glShaderSource(shader, shaderCode);
        GLES20.glCompileShader(shader);
        return shader;
    }
}

Related Tutorials