Well after locating where the crash occurs and doing some serach on net, I found the cause is glGenVertexArrays in GL core mode sometimes cause problems with glew so just before glewInit() add the line:
glewExperimental = GL_TRUE;
and it works
I found the answer here:
Hope this will help others...
And just for the curious I reverted to the original code without layout in shaders and used version 330 and it did work on both ATI and GeForce. So it was a glew problem...
Well, if you want an easy alternative for glew, may I suggest using my LoadGL.h header. It has all OpenGL constants defined in it as well as function pointers up to 4.4 version. In contrast to other wrappers and loaders, this one loads each OpenGL function you ever call the first time it is called, independently from the others, therefore you do not need to bother initializing anything - simply dump the file into your project directory and place an #include "LoadGL.h" somewhere in it.
Just an option.
Thanks, I will give it a try. Another fix, is by keeping the original code and just change the profile from GLUT_CORE_PROFILE into GLUT_COMPATIBILITY_PROFILE and it works fine, without adding anything else or changing anything else...
Tags for this Thread