- glDisable(GL_TEXTURE_2D);
- glBegin(GL_QUADS);
-
- glColor3f(0.0f, 0.0f, 0.0f);
- glVertex2f(0.0f * 9.0f / 16.0f, y + 0.02f);
- glVertex2f(0.0f * 9.0f / 16.0f, y);
-
- glColor3f(1.0f, 1.0f, 1.0f);
- glVertex2f(0.2f * 9.0f / 16.0f, y);
- glVertex2f(0.2f * 9.0f / 16.0f, y + 0.02f);
-
- glEnd();
+ glUseProgram(colored_program_num);
+ float value_vertices[] = {
+ 0.0f * 9.0f / 16.0f, y + 0.02f,
+ 0.2f * 9.0f / 16.0f, y + 0.02f,
+ 0.0f * 9.0f / 16.0f, y,
+ 0.2f * 9.0f / 16.0f, y,
+ };
+ float value_colors[] = {
+ 0.0f, 0.0f, 0.0f,
+ 1.0f, 1.0f, 1.0f,
+ 0.0f, 0.0f, 0.0f,
+ 1.0f, 1.0f, 1.0f,
+ };
+ GLuint position_vbo = fill_vertex_attribute(colored_program_num, "position", 2, GL_FLOAT, sizeof(value_vertices), value_vertices);
+ GLuint color_vbo = fill_vertex_attribute(colored_program_num, "color", 3, GL_FLOAT, sizeof(value_colors), value_colors);
+ check_error();
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ check_error();
+ cleanup_vertex_attribute(colored_program_num, "position", position_vbo);
+ cleanup_vertex_attribute(colored_program_num, "color", color_vbo);