【问题标题】:Having an issue with "gladLoadGL". I'm getting an error saying it does not take 1 argument“gladLoadGL”有问题。我收到一个错误,说它不需要 1 个参数
【发布时间】:2019-09-22 22:35:27
【问题描述】:

我正在尝试做一些 openGL 教程 (https://www.glfw.org/docs/latest/quick_guide.html#quick_example),其中一个功能是gladLoadGL。代码行是“gladLoadGL(glfwGetProcAddress);”但是,当我尝试运行时,我收到错误“C2660 'gladLoadGL': function does not take 1 arguments”。

我尝试过在线搜索,但似乎没有人遇到与我相同的问题。我查看了glad.h 文件,该函数有一个警告“未找到函数定义gladLoadGL”,这可能是我的问题所在。当我生成高兴的代码 (https://glad.dav1d.de/) 时,我的设置是语言 C/C++、规范 OpenGL、gl 版本 4.6、配置文件核心和生成加载程序。

gladLoadGL(glfwGetProcAddress);

【问题讨论】:

    标签: opengl glad


    【解决方案1】:

    用途:

    a) 来自具有加载器的已知 API 的加载器,例如glfw

    gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
    

    b)直接:

    gladLoadGL();
    

    注意不同的使用功能。

    【讨论】:

    • 这非常有效。我最终使用了您的第二个解决方案,但我也忘记了包含glad.c。非常感谢
    • 第一个对我有用,而第二个没有
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-05-06
    • 2016-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-12
    • 1970-01-01
    相关资源
    最近更新 更多