Ejemplo n.º 1
0
        // we are defining extensions for a class generated from IDL

        public static WebGLProgram createProgram(this WebGLRenderingContext gl, VertexShader v, FragmentShader f)
        {
            var programHandle = gl.createProgram();

            var vs = gl.createShader(v);
            var fs = gl.createShader(f);

            gl.attachShader(programHandle, vs);
            gl.attachShader(programHandle, fs);

            gl.deleteShader(vs);
            gl.deleteShader(fs);
            // http://www.seas.upenn.edu/~pcozzi/OpenGLInsights/OpenGLInsights-ANGLE.pdf
            // are implicitly linked when the shaders are made active.

            return(programHandle);
        }