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

10-31 20:43