I’m using freeglut 2.6.0 and GLEW 1.5.4 and if I use forward compatible context in following way:
glutInitContextVersion(3,0);
glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
I get access violation because glGenVertexArrays is 0.
I’m using freeglut 2.6.0 and GLEW 1.5.4 and if I use forward compatible context in following way:
glutInitContextVersion(3,0);
glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
I get access violation because glGenVertexArrays is 0.
Have you called glewInit after context creation?
Yes, I have called glewInit(), here’s initialization code
from my main():
glutInit(&argc, argv);
glutInitContextVersion(3,0);
//glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(800,800);
glutInitWindowPosition(100,100);
glutCreateWindow(“sv”);
if (glewInit() != GLEW_OK)
{
printf("GLEW initialization failed…
");
return 1;
}
init();
init() calls glGenVertexArrays() and if I uncomment glutInitContextFlags() it causes access violation.
Ok, I looked into the specs and it’s surely not deprecated…
I used glutGetProcAddress() to get pointer to glGenVertexArrays() and after that I got access violation for glBindVertexArray(). After getting glBindVertexArray() also the program didn’t anymore crash (though it didn’t exactly work either, it used too many deprecated features…).