createProgram static method
Creates the program.
This creates a program then attatch the vertex and fragment shaders and if succed returns the program id.
glthe OpenGlES context.vertexShaderthe vertex shader id.fragmentShaderthe fragment shader id.
Implementation
static int createProgram(OpenGLContextES gl, int vertexShader, int fragmentShader) {
int program = gl.createProgram();
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);
gl.linkProgram(program);
var success = gl.getProgramParameter(program, gl.LINK_STATUS);
if (success != 0 || success != false) {
return program;
}
print('getProgramInfoLog: ${gl.getProgramInfoLog(program)}');
gl.deleteProgram(program);
throw 'failed to create the program';
}