PDA

View Full Version : glGenVertexArrays deprecated?



jamse101
05-15-2010, 06:27 AM
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.

martinsm
05-15-2010, 06:46 AM
Have you called glewInit after context creation?

jamse101
05-15-2010, 06:57 AM
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...\n");
return 1;
}

init();

init() calls glGenVertexArrays() and if I uncomment glutInitContextFlags() it causes access violation.

jamse101
05-15-2010, 12:29 PM
Ok, I looked into the specs and it's surely not deprecated..

jamse101
05-16-2010, 08:23 AM
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..).