I am sure that everything is linked correcly. I initially was using glload and glfw from the Unofficial GLSDK but then I decided to do away with glload which meant that I had to use glew in order to get at the modern headers.
#include <GL/glew.h>
#include <GL/glfw.h>
I have included glew before glfw as per the instructions.
During run time the OpenGL window opens
//(relevant code)
if(!glewInit()) {return -1; }
if(!glfwInit()) {return -1; }
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
// also tried glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE);
if(!glfwOpenWindow(1024, 768, 8, 8, 8, 8, 24, 8, GLFW_WINDOW)){
glfwTerminate();
return -1;
}
glfwSetWindowTitle("OpenGL 3.2");
//init method
glGenVertexArrays(1, &vao); //<< Access violation here.
Any ideas what my problem is here?
I have looked at. "Access violation using VBO with glew" But it was no help.
glewInit
is to be called after a OpenGL context has been created and bound to the current thread, i.e. after glfwOpenWindow
in your case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With