5 shader.addShaderFromSourceFile(QGLShader::Vertex, ":/gl/quad.vert");
6 shader.addShaderFromSourceFile(QGLShader::Fragment, ":/gl/quad.frag");
10 -1, -1, 0.00, 0.10, 0.15,
11 -1, 1, 0.03, 0.21, 0.26,
12 1, -1, 0.00, 0.12, 0.18,
13 1, 1, 0.06, 0.26, 0.30};
17 vertices.allocate(vbuf, sizeof(vbuf));
26 const GLuint vp = shader.attributeLocation("vertex_position");
27 const GLuint vc = shader.attributeLocation("vertex_color");
29 glEnableVertexAttribArray(vp);
30 glEnableVertexAttribArray(vc);
32 glVertexAttribPointer(vp, 2, GL_FLOAT, false,
33 5 * sizeof(GLfloat), 0);
34 glVertexAttribPointer(vc, 3, GL_FLOAT, false,
36 (GLvoid*)(2 * sizeof(GLfloat)));
38 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);