OpenGL扩展:如何在OS X下使用它们

编程入门 行业动态 更新时间:2024-10-20 11:28:07
OpenGL扩展:如何在OS X下使用它们 - OpenGL新手(OpenGL Extensions: How to use them under OS X — OpenGL newbie)

任何人都可以指出我使用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

更多推荐

本文发布于:2023-07-06 08:00:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1047612.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   OpenGL   OS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!