The draw code is:
void display_func(void)
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glDrawElements(GL_TRIANGLES, triangle_indices.size()*3, GL_UNSIGNED_INT, 0);
glFlush();
}
There are no errors with the shader compile and link.
I specify the type as GLuint in the last line of this code:
// Transfer vertex data to GPU
glGenVertexArraysAPPLE(1, vaos);
glBindVertexArrayAPPLE(vaos[0]);
glGenBuffers(1, &buffers[0]);
glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
glBufferData(GL_ARRAY_BUFFER, vertices_with_face_normals.size()*6*sizeof(float), &vertices_with_face_normals[0], GL_STATIC_DRAW);
// Set up vertex positions
glVertexAttribPointer(0, 6/2, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (GLvoid*)0);
glEnableVertexAttribArray(0);
// Set up vertex normals
glVertexAttribPointer(1, 6/2, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (GLvoid*)(6/2 * sizeof(GLfloat)));
glEnableVertexAttribArray(1);
// Transfer index data to GPU
glGenBuffers(1, &buffers[1]);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffers[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, triangle_indices.size()*3*sizeof(GLuint), &triangle_indices[0], GL_STATIC_DRAW);