I need to load textures into a background thread in OpenGL ES. But glGenTextures always returns zero when called in the background thread.
-(void) someMethodInMainThread { [self performSelectorInBackground:@selector(load) withObject:nil]; } -(void) load { GLuint textureID = 0; glGenTextures(1, &textureID); }
textureID is zero. If I changed the code to [self performSelector: @selector (tmp) withObject: nil]; it will work correctly and return 1. How to load textures into the background stream?
multithreading iphone opengl-es
Division
source share