Glew does not init

2019-09-19 03:27发布

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条回答
闹够了就滚
2楼-- · 2019-09-19 03:45

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.

查看更多
登录 后发表回答