iOS 5 未声明的标识符 GL_TEXTURE_RECTANGLE
我在 iOS(iPhone 3gs 或更高版本)上使用矩形纹理时遇到问题
我尝试使用 GL_TEXTURE_RECTANGLE
和/或 GL_EXT_texture_rectangle
但 XCODE 自动完成功能无法识别它,我认为是因为未导入正确的头文件并引发了未声明的标识符
错误。
还尝试了 GL_ARB_texture_non_power_of_two
和 GL_ARB_texture_rectangle
如本问题中的回答OpenGL ES GL_TEXTURE_RECTANGLE 但没有声明。
我用谷歌搜索并没有找到对其声明的标头的引用,也找不到文档示例项目中使用的标头文件。
- 在 xcode 4.2 上工作,
这些是我当前导入的标头:
#import <OpenGLES/EAGL.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
也尝试导入这些
#import <OpenGL/OpenGL.h> //file not found
#import <OpenGL.h> //file not found
#import <OpenGL/glu.h> //file not found
I'm having trouble using a rectangular texture on iOS (iPhone 3gs or newer)
I'm trying to use GL_TEXTURE_RECTANGLE
and/or GL_EXT_texture_rectangle
but XCODE autocomplete doesn't recognize it, i think because the proper header file is not imported and throws me the undeclared identifier
error.
Also tried GL_ARB_texture_non_power_of_two
and GL_ARB_texture_rectangle
as answered in this question OpenGL ES GL_TEXTURE_RECTANGLE but none are declared.
I've googled and haven't found a reference to the header it is declared, the header files used in the documentation sample projects are not found.
- Working on xcode 4.2
these are the headers I'm currently importing:
#import <OpenGLES/EAGL.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
also tried to import these
#import <OpenGL/OpenGL.h> //file not found
#import <OpenGL.h> //file not found
#import <OpenGL/glu.h> //file not found
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iOS 上的 OpenGL ES 不支持矩形纹理。 请参阅此处,了解 iOS 支持的 OpenGL ES 扩展的完整列表。
您使用的是 ES 1.1 还是 ES 2.0? ES2 有 NPOT 纹理支持,因此您可以使用它来代替矩形纹理。
OpenGL ES on iOS doesn't support rectangle textures. See here for full list of OpenGL ES extensions supported on iOS.
Are you using ES 1.1 or ES 2.0? ES2 has NPOT texture support, so you could use that instead of rectangle textures.