I used the below code to load the texture on a object.
- (void)ldText:(UIImage *)Image
{
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
CGImageRef cgImage = Image.CGImage;
float Width = CGImageGetWidth(cgImage);
float Height = CGImageGetHeight(cgImage);
CFDataRef data = CGDataProviderCopyData(CGImageGetDataProvider(cgImage));
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Width, Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, CFDataGetBytePtr(data));
}
The texture is getting mapped properly.
I need to load two textures now. And the textures should get changed at regular interval of time. Is it possible? Can Some one guide me how to proceed from here?
*Update: I loaded another texture with Image2, with the function ldText2. And updating it in each "update view". Now I get two textures on the same object and getting changed whenever the "update" function is called. I interchange the texture1 and texture2 each time when the "Update" function is called. But the problem is time interval! I want it to happen slow. How to set a time interval for this?*