Code core (displaying a red rectangle):
//bind program, set uniforms, bind vbo glEnableVertexAttribArray(0); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0,0); glDrawArrays(GL_TRIANGLES, 0, 6); glDisableVertexAttribArray(0); //unbind vbo, unbind program
When I switch the context to OpenGL 3.x, this code stops working (I see only the background color), but when I initialize VAO in the same way as the code above, and then I bind VAO and call glDrawArrays, then it works.
What could be the problem? How can I draw a VBO without using a VAO?
(shaders are really simple, vs only mulitplies matrices and ps outputs are red)
opengl opengl-3 vbo
chris
source share