我需要在OpenGL ES的后台线程中加载纹理。但在后台线程中调用glGenTextures时总是返回零。glGenTextures在后台线程中返回零
-(void) someMethodInMainThread {
[self performSelectorInBackground:@selector(load) withObject:nil];
}
-(void) load {
GLuint textureID = 0;
glGenTextures(1, &textureID);
}
textureID为零。 如果我将代码更改为[self performSelector:@selector(tmp)withObject:nil];它会正常工作,并返回1. 我应该如何加载后台线程纹理?
我必须使用EAGLSharegroup? – Division 2010-08-12 13:48:13
看起来像,我不是iPhone的专家,但通过谷歌搜索,我看到这是在GL环境之间共享资源的句柄。 – 2010-08-12 13:55:43