1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| glClear(GL_COLOR_BUFFER_BIT);
//set triangle color //glUniform4f(uColorLocation, 1.0f, 1.0f, 1.0f, 1.0f); //draw two triangles glDrawArrays(GL_TRIANGLE_FAN, 0, 6);
//set line color //glUniform4f(uColorLocation, 1.0f, 0.0f, 0.0f, 1.0f); glDrawArrays(GL_LINES, 6, 2);
//draw the first blue mallets //glUniform4f(uColorLocation, 0.0f, 0.0f, 1.0f, 1.0f); glDrawArrays(GL_POINTS, 8, 1);
//draw the second red mallets //glUniform4f(uColorLocation, 1.0f, 0.0f, 0.0f, 1.0f); glDrawArrays(GL_POINTS, 9, 1);
|