glGenBuffers 未定义?

glGenBuffers not defined?(glGenBuffers 未定义?)
本文介绍了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 未定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)
STL BigInt class implementation(STL BigInt 类实现)
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)