问题
I am using the following code to check for any error:
glfwInit();
glewExperimental = GL_TRUE;
if (glewInit() != 0)
{
std::cout << "Failed to initialize GLEW" << std::endl;
return -1;
}
I am using the non static version of Glew and I have included the .dll file in the Debug folder. I am using Visual Studio Community 2013. All other solutions suggested to set glewExperimental to GL_True or check the error checking, but I have done that and it is still does not work.
回答1:
You don't have a GL context just by glfwInit()
, so GLEW has nothing to work on. You must create a GL context and make it current to the thread, which for GLFW implies creating a window.
来源:https://stackoverflow.com/questions/29873318/glew-does-not-init