Glew不初始化 [英] Glew does not init

查看:134
本文介绍了Glew不初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码检查任何错误:

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;
}

我正在使用Glew的非静态版本,并且在Debug文件夹中包含了.dll文件.我正在使用Visual Studio Community2013.建议所有其他解决方案将glewExperimental设置为GL_True或检查错误检查,但是我已经做到了,但仍然无法正常工作.

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.

推荐答案

仅凭glfwInit()您就没有GL上下文,因此GLEW不需要任何处理.您必须创建一个GL上下文并将其作为线程的当前对象,这对于GLFW意味着创建一个窗口.

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.

这篇关于Glew不初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆