我需要在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