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 未定义?


基础教程推荐
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 从 std::cin 读取密码 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01