5 initializeOpenGLFunctions();
7 shader.addShaderFromSourceFile(QOpenGLShader::Vertex, ":/gl/quad.vert");
8 shader.addShaderFromSourceFile(QOpenGLShader::Fragment, ":/gl/quad.frag");
12 -1, -1, 0.00, 0.10, 0.15,
13 -1, 1, 0.03, 0.21, 0.26,
14 1, -1, 0.00, 0.12, 0.18,
15 1, 1, 0.06, 0.26, 0.30};
19 vertices.allocate(vbuf, sizeof(vbuf));
28 const GLuint vp = shader.attributeLocation("vertex_position");
29 const GLuint vc = shader.attributeLocation("vertex_color");
31 glEnableVertexAttribArray(vp);
32 glEnableVertexAttribArray(vc);
34 glVertexAttribPointer(vp, 2, GL_FLOAT, false,
35 5 * sizeof(GLfloat), 0);
36 glVertexAttribPointer(vc, 3, GL_FLOAT, false,
38 (GLvoid*)(2 * sizeof(GLfloat)));
40 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);