【发布时间】:2010-08-12 13:06:49
【问题描述】:
我需要在 OpenGL ES 的后台线程中加载纹理。但是 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。 我应该如何在后台线程中加载纹理?
【问题讨论】:
标签: iphone multithreading opengl-es