glGenTextures GLuint 还是数组?
首先,我对 C/C++ 的了解很少,所以我的知识可能有一个黑点,但我目前正在尝试将 OpenGL 的一些功能移植到 AS3 并查看 OpenGL 的 glGenTextures() 方法
< a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenTextures.xml" rel="nofollow">http://www.opengl.org/sdk/docs/man/xhtml/ glGenTextures.xml
这个方法需要几个,但我的问题是针对后面的参数
GLuint * 纹理
我查找了 GLuint 的类型数据,它似乎是一个 32 位无符号整数,但是文档然后说以下:
textures 指定存储生成的纹理名称的数组。
那么,GLuint 是一个数组还是一个无符号整数??如果这是某种指向数组内存地址的指针(不知道这是否也是可能的?)那么任何人都可以推荐一种等效的实现方法ActionScript 中具有类似的功能,请记住参数是按值计算的,而不是在 ActionScript 中按引用计算的。
非常感谢 SO 上的所有好心人。
加里·帕鲁克
Firstly, I have very little knowledge of C/C++ so there might be a black spot in my knowledge with that but I'm currently attempting to port some of the functionality of OpenGL to AS3 and looking at the glGenTextures() method of OpenGL
http://www.opengl.org/sdk/docs/man/xhtml/glGenTextures.xml
This method takes a couple of but my question is aimed at the later parameter
GLuint * textures
I looked up the type data for GLuint and it appears to be a 32 bit unsigned integer, however the documentation then says the following:
textures Specifies an array in which the generated texture names are stored.
So, is GLuint an array or is it an unsigned integer??, and if this is some kind of pointer to a memory address of an Array (have no idea if that's also a possibilty?) Then can anyone recommend an equivalent way of implementing similar functionality within ActionScript bearing in mind that the parameters are by value and not by reference within ActionScript.
Many thanks to all the good people on SO.
Gary Paluk
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您熟悉指针表示法吗?函数确实接受一个数组:一个 GLuint 数据数组。因此,在创建纹理时,您可以创建一个纹理并简单地指向该 GLuint 的地址,也可以通过传入第一个纹理的指针来创建多个纹理(这基本上就是数组的工作方式)。
Are you familiar with pointer notation? The function does take an array: an array of GLuint data. So, when creating a texture, you can either create one texture and simply point to the address of that one GLuint, or you can create multiple textures by passing in a pointer to the first one (which is basically how arrays work).
GLuint 是一个无符号整数。
您可以在头文件中看到它:
这是 OpenGL 2 头文件
这里是即将推出的 OpenGL 3 的链接头文件
如果您以前没有遇到过 typedeff,这里是解释 typedef 的 Wiki 页面
GLuint is an unsigned int.
You can see it in the header files as:
Here's a link the the OpenGL 2 header file
And here's a link for the upcoming OpenGL 3 header file
In case you haven't come across typedeff before, here's the Wiki page explaining typedef