glGenBuffers not defined?(glGenBuffers 未定义?)
问题描述
我使用的是 windows,我注意到很多函数都变灰了,因为我猜 #ifdef GL_GLEXT_PROTOTYPES 没有定义.其中之一是 VBO 扩展.我应该只定义 GL_GLEXT_PROTOTYPES 吗?否则我还能如何使用 VBO,因为我使用的是 OpenGL32.dll(我希望我的应用程序没有默认情况下不包含在 Windows 中的 dll 依赖项.)谢谢
I'm using windows and I notice that a lot of functions are grayed out because I guess #ifdef GL_GLEXT_PROTOTYPES is not defined. One of these is the VBO extension. Should I just define GL_GLEXT_PROTOTYPES? Otherwise how else can I use VBOs since im using OpenGL32.dll (I want my application to have no dll dependencies not included in Windows by default.) Thanks
推荐答案
我建议你使用 GLEW 来解决这个问题.
I recommend that you use GLEW to get rid of that problem.
这是一个很长的故事,但回顾一下,Windows 的 OpenGL 库仅公开 OpenGL 1.1 入口点,因此该版本以外的所有函数都使用 wglGetProcAddress 加载.GLEW 通过这样做解决了这个问题.
It's a long story, but resuming, Windows' OpenGL library only exposes OpenGL 1.1 entry points, so all functions beyond that version are loaded with wglGetProcAddress. GLEW solves this problem by doing that.
http://glew.sourceforge.net/
只需链接到 GLEW 和 GLU/GLUT(如果您使用它们).
Just link to GLEW and GLU/GLUT (if you use them).
这篇关于glGenBuffers 未定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:glGenBuffers 未定义?


基础教程推荐
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 这个宏可以转换成函数吗? 2022-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01