public static __WebGLProgram createAndLinkProgram(this gl gl, ScriptCoreLib.GLSL.VertexShader vertexShaderHandle, ScriptCoreLib.GLSL.FragmentShader fragmentShaderHandle, params string[] attributes)
 {
     return(gl.createAndLinkProgram(
                gl.createShader(vertexShaderHandle),
                gl.createShader(fragmentShaderHandle),
                attributes
                ));
 }
        private static __WebGLShader createShader(this gl gl, int shaderType, string shaderSource)
        {
            var shaderHandle = gl.createShader(shaderType);


            // Pass in the shader source.
            gl.shaderSource(shaderHandle, shaderSource);

            // Compile the shader.
            gl.compileShader(shaderHandle);

            // Get the compilation status.
            int[] compileStatus = new int[1];
            GLES20.glGetShaderiv(shaderHandle.value, GLES20.GL_COMPILE_STATUS, compileStatus, 0);

            // If the compilation failed, delete the shader.
            if (compileStatus[0] == 0)
            {
                Log.e("createShader", GLES20.glGetShaderInfoLog(shaderHandle.value));
                gl.deleteShader(shaderHandle);
                shaderHandle = null;
            }

            if (shaderHandle == null)
            {
                //throw new RuntimeException("Error creating shader.");
                throw null;
            }

            return(shaderHandle);
        }
 public static __WebGLShader createShader(this gl gl, ScriptCoreLib.GLSL.VertexShader fragmentShader)
 {
     return(gl.createShader(GLES20.GL_VERTEX_SHADER, fragmentShader.ToString()));
 }
 public static __WebGLShader createShader(this gl gl, ScriptCoreLib.GLSL.FragmentShader fragmentShader)
 {
     return(gl.createShader(GLES20.GL_FRAGMENT_SHADER, fragmentShader.ToString()));
 }