任何人都可以指出我使用OS X使用OpenGL Extensions的一个很棒的教程或操作方法。我正在学习OpenGL和一些新手。 我正在使用教科书来学习图形,但它没有提供有关如何使代码工作的平台特定说明。
我在带有NVidia GeForce 9400M的MacBookPro上运行OS X(10.6.7)。 我安装了XCode,所以我有必要的头文件和库来编译和运行图形代码。 我正在尝试使用OpenGL扩展,现在我被卡住了。 这是我的问题:
我的教科书中的一个例子使用了一个名为glGenVertexArrays的函数。 我在glext.h中看到有一个名为glGenVertexArrays的函数,它旁边有一个APIENTRYP,下面有一个typedef:
wdyn-n233-240-235:GL marklagatuz$ cat glext.h | grep glGenVertexArrays GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *); GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);我的问题是如何在我的.cpp源代码中使用此功能? 我已经仔细阅读了网络,并没有找到很好的文档。 也许因为我是新手。 有人能指点我一些很棒的帮助和教程吗?
Can anybody point me in a direction to a great tutorial or how-to for using OpenGL Extensions using OS X. I'm learning OpenGL and somewhat of a newbie. I'm using a textbook to learn graphics but it doesn't give platform specific instructions on how to get the code to work.
I'm running OS X(10.6.7) on a MacBookPro with a NVidia GeForce 9400M. I have XCode installed, so I have the necessary headers and libraries to compile and run graphics code. I'm attempting to use the OpenGL extensions and now I'm stuck. Here's my problem:
An example in my textbook utilizes a function called glGenVertexArrays. I see in glext.h that there is a function called glGenVertexArrays, a APIENTRYP next to it, and a typedef slightly below it:
wdyn-n233-240-235:GL marklagatuz$ cat glext.h | grep glGenVertexArrays GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *); GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);My question is how to utilize this function in my .cpp source code? I've perused the net, and haven't found great documentation. Maybe cause I'm new to this. Could somebody point me into some great help and tutorials?
最满意答案
如果你想让你的生活变得简单,不要打扰glext.h而是使用扩展包装器。 我推荐GLEW, http: //glew.sourceforge.net
If you want to make your life simple, don't bother with glext.h but use a extension wrapper instead. I recommend GLEW, http://glew.sourceforge.net
更多推荐
发布评论