I've just started to learn OpenGL 3 and I'm using freeglut for the context. I ask for a 3.3 context using:
glutInitContextVersion(3,3);
glutInitContextFlags(GLUT_FORWARD_COMPATIBLE | GLUT_DEBUG);
I then query the version I'm using with:
int glVersion[2] = {0,0};
glGetIntegerv(GL_MAJOR_VERSION, &glVersion[0]);
glGetIntegerv(GL_MINOR_VERSION, &glVersion[1]);
Furthermore in my simple program, I create a triangle using a VBO. When I compile and run, the triangle is not rendered.
There are three ways that fix the problem and I don't understand why. The first method is to uncomment the first two lines of code I posted. In this case, the 3 next lines I posted, still report that I'm using OpenGL 3.3.
The second method it to wrap the VBO in a VAO.
The third one is to ask for a 2.1 context but in this case a version 3.3 is being reported again.
Could you help me understand this behaviour? Is it specified somewhere in the OpenGL specification that a VBO needs to be wrapped in a VAO in versions 3.x?