Try moving

glGenVertexArrays(1, &vao);
glBindVertexArray(vao);

at the top.

Reply via email to